Hi guys,

  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)


*The main reason is we do not add % as a operator token:*

/* OPERATORS */

<DEFAULT, DQID, BTID> TOKEN :
{
    < EQ: "=" >
|   < GT: ">" >
|   < LT: "<" >
|   < HOOK: "?" >
|   < COLON: ":" >
|   < LE: "<=" >
|   < GE: ">=" >
|   < NE: "<>" >
|   < NE2: "!=" >
|   < PLUS: "+" >
|   < MINUS: "-" >
|   < STAR: "*" >
|   < SLASH: "/" >
|   < CONCAT: "||" >
|   < NAMED_ARGUMENT_ASSIGNMENT: "=>" >
|   < DOUBLE_PERIOD: ".." >
|   < QUOTE: "'" >
|   < DOUBLE_QUOTE: "\"" >
|   < VERTICAL_BAR: "|" >
|   < CARET: "^" >
|   < DOLLAR: "$" >
}

In MySQL, SQL Server are supported. For Oracle, you have to use the
MOD function.

So I'm not sure if calcite needs support, What do you think?

Welcome anybody feedback. -:)

Hope your opine. @Julian

Best,

Jincheng

Reply via email to