[
https://issues.apache.org/jira/browse/CALCITE-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112428#comment-16112428
]
Julian Hyde commented on CALCITE-1897:
--------------------------------------
Review comments:
* I think you should call the parser symbol PERCENT. REMAINDER is a different
function from MOD in Oracle, so using that name is confusing.
* I'm glad you introduced SqlKind.MOD. But you should change
SqlStdOperatorTable.MOD to use it.
* Add tests that prove that the precedence of % is correct, e.g. a + b % c % d
* e % f.
* Only allow % in certain conformance levels (MYSQL and LENIENT)
* Are you re-using the same code-generation code as MOD? Doesn't look like it.
You should translate % to MOD as early as possible to, so you benefit from the
existing infrastructure around MOD.
> Support operator "%" as an alternative to "mod"
> -----------------------------------------------
>
> Key: CALCITE-1897
> URL: https://issues.apache.org/jira/browse/CALCITE-1897
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: sunjincheng
> Assignee: sunjincheng
>
> Currently the following sql is not supported.
> SELECT a%3 FROM T
> We get the exception:
>
> Caused by: org.apache.calcite.sql.parser.SqlParseException: Lexical
> error at line 1, column 9. Encountered: "%" (37), after : ""
> at
> org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:396)
> at
> org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:129)
> In this JIRA. I'll fix this by support operator "%" as an alternative to
> "mod".
> Similar https://issues.apache.org/jira/browse/CALCITE-1374
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)