[
https://issues.apache.org/jira/browse/CALCITE-1897?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16125178#comment-16125178
]
sunjincheng commented on CALCITE-1897:
--------------------------------------
Hi, [~julianhyde]Thanks for your review. and sorry for late reply. I had update
the PR. according your comments. the changes as follows:
1. Change the symbol `REMAINDER ` to `PERCENT_REMAINDER ` ;
2. Mod function using `SqlKind.MOD`;
3. Add ModPrecedenceTest;
4. Add limitation of conformance levels.(MYQL_5 & LENIENT)
5. Uses same code-generation code for both `%` and `mod function`.
but i am not sure if the changes are 100% match your comments. I am grateful if
can review the changes again.
About your comments, i have a question: Why only allow % in the MYSQL and
LENIENT. How can i know that before you told me. Is there some document you can
share me to study ?
changes reference:
1.
http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions101.htm#SQLRF00668
> 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)