FLINK SQL文档示例是否正确

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FLINK SQL文档示例是否正确

张韩
问题:
文档(<a href="https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/sql/queries.html#scan-projection-and-filter)使用'%'求余运算,在SQL解析报错:">https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/sql/queries.html#scan-projection-and-filter)使用'%'求余运算,在SQL解析报错:
org.apache.calcite.sql.parser.SqlParseException: Percent remainder '%' is not allowed under the current SQL conformance level


MYSQL conformance 支持'%'运算,使用MYSQL CONFORMANCE,在SQL语法校验过程会找不到'%'对应的SqlOperator





Reply | Threaded
Open this post in threaded view
|

Re: FLINK SQL文档示例是否正确

Jark
Administrator
Good catch! 在 Flink 中需要用 mod(a, 4) 做取余运算。 % 不是一个 SQL 标准操作符。

我开了个 issue 去跟进这个问题:要么改文档,要么允许 % 操作符。

https://issues.apache.org/jira/browse/FLINK-18240

Best,
Jark

On Wed, 10 Jun 2020 at 18:34, 张韩 <[hidden email]> wrote:

> 问题:
> 文档(
> https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/table/sql/queries.html#scan-projection-and-filter)
> 使用'%'求余运算,在SQL解析报错:
> org.apache.calcite.sql.parser.SqlParseException: Percent remainder '%' is
> not allowed under the current SQL conformance level
>
>
> MYSQL conformance 支持'%'运算,使用MYSQL
> CONFORMANCE,在SQL语法校验过程会找不到'%'对应的SqlOperator
>
>
>
>
>
>