You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/01/27 21:08:49 UTC

[GitHub] [pinot] xiangfu0 opened a new issue #8079: Calcite parsing on column contains keyword.

xiangfu0 opened a new issue #8079:
URL: https://github.com/apache/pinot/issues/8079


   E.g. Running OfflineComplexTypeHandlingQuickStart
   
   Then execute query:
   ```
   SELECT  payload.commits.distinct  FROM githubEvents LIMIT 1
   ```
   
   Stacktrace:
   ```
   2022/01/27 13:08:14.166 ERROR [PinotQueryResource] [grizzly-http-server-25] Caught exception while compiling SQL query: SELECT  payload.commits.distinct  FROM githubEvents LIMIT 1
   org.apache.pinot.sql.parsers.SqlCompilationException: Caught exception while parsing query: SELECT  payload.commits.distinct  FROM githubEvents LIMIT 1
   	at org.apache.pinot.sql.parsers.CalciteSqlParser.compileCalciteSqlToPinotQuery(CalciteSqlParser.java:330) ~[classes/:?]
   	at org.apache.pinot.sql.parsers.CalciteSqlParser.compileToPinotQuery(CalciteSqlParser.java:134) ~[classes/:?]
   	at org.apache.pinot.sql.parsers.CalciteSqlCompiler.compileToBrokerRequest(CalciteSqlCompiler.java:35) ~[classes/:?]
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.getQueryResponse(PinotQueryResource.java:166) ~[classes/:?]
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.handlePostSql(PinotQueryResource.java:137) ~[classes/:?]
   	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
   	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
   	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
   	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
   	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.internal.Errors.process(Errors.java:292) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.internal.Errors.process(Errors.java:274) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.internal.Errors.process(Errors.java:244) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) [jersey-common-2.28.jar:?]
   	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:679) [jersey-server-2.28.jar:?]
   	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:353) [jersey-container-grizzly2-http-2.28.jar:?]
   	at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:200) [grizzly-http-server-2.4.4.jar:2.4.4]
   	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:569) [grizzly-framework-2.4.4.jar:2.4.4]
   	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:549) [grizzly-framework-2.4.4.jar:2.4.4]
   	at java.lang.Thread.run(Thread.java:834) [?:?]
   Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered ". distinct" at line 1, column 24.
   Was expecting one of:
       <EOF> 
       "ORDER" ...
       "LIMIT" ...
       "OFFSET" ...
       "FETCH" ...
       "FROM" ...
       "," ...
       <IDENTIFIER> ...
       <QUOTED_IDENTIFIER> ...
       <BACK_QUOTED_IDENTIFIER> ...
       <BRACKET_QUOTED_IDENTIFIER> ...
       <UNICODE_QUOTED_IDENTIFIER> ...
       "UNION" ...
       "INTERSECT" ...
       "EXCEPT" ...
       "MINUS" ...
       "." <IDENTIFIER> ...
       "." <QUOTED_IDENTIFIER> ...
       "." <BACK_QUOTED_IDENTIFIER> ...
       "." <BRACKET_QUOTED_IDENTIFIER> ...
       "." <UNICODE_QUOTED_IDENTIFIER> ...
       "IN" ...
       "<" ...
       "<=" ...
       ">" ...
       ">=" ...
       "=" ...
       "<>" ...
       "!=" ...
       "+" ...
       "-" ...
       "*" ...
       "/" ...
       "%" ...
       "||" ...
       "[" ...
       "." "*" ...
       "(" ...
       
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.convertException(SqlBabelParserImpl.java:355) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.normalizeException(SqlBabelParserImpl.java:143) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:156) ~[calcite-core-1.19.0.jar:1.19.0]
   	at org.apache.pinot.sql.parsers.CalciteSqlParser.compileCalciteSqlToPinotQuery(CalciteSqlParser.java:328) ~[classes/:?]
   	... 30 more
   Caused by: org.apache.calcite.sql.parser.babel.ParseException: Encountered ". distinct" at line 1, column 24.
   Was expecting one of:
       <EOF> 
       "ORDER" ...
       "LIMIT" ...
       "OFFSET" ...
       "FETCH" ...
       "FROM" ...
       "," ...
       <IDENTIFIER> ...
       <QUOTED_IDENTIFIER> ...
       <BACK_QUOTED_IDENTIFIER> ...
       <BRACKET_QUOTED_IDENTIFIER> ...
       <UNICODE_QUOTED_IDENTIFIER> ...
       "UNION" ...
       "INTERSECT" ...
       "EXCEPT" ...
       "MINUS" ...
       "." <IDENTIFIER> ...
       "." <QUOTED_IDENTIFIER> ...
       "." <BACK_QUOTED_IDENTIFIER> ...
       "." <BRACKET_QUOTED_IDENTIFIER> ...
       "." <UNICODE_QUOTED_IDENTIFIER> ...
       "IN" ...
       "<" ...
       "<=" ...
       ">" ...
       ">=" ...
       "=" ...
       "<>" ...
       "!=" ...
       "+" ...
       "-" ...
       "*" ...
       "/" ...
       "%" ...
       "||" ...
       "[" ...
       "." "*" ...
       "(" ...
       
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.generateParseException(SqlBabelParserImpl.java:31520) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.jj_consume_token(SqlBabelParserImpl.java:31337) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.SqlStmtEof(SqlBabelParserImpl.java:878) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.babel.SqlBabelParserImpl.parseSqlStmtEof(SqlBabelParserImpl.java:199) ~[calcite-babel-1.19.0.jar:1.19.0]
   	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:148) ~[calcite-core-1.19.0.jar:1.19.0]
   	at org.apache.pinot.sql.parsers.CalciteSqlParser.compileCalciteSqlToPinotQuery(CalciteSqlParser.java:328) ~[classes/:?]
   	... 30 more
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on issue #8079: Calcite parsing error on column contains keywords

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on issue #8079:
URL: https://github.com/apache/pinot/issues/8079#issuecomment-1026104938


   Is this query supported in presto? This query syntax is not supported by Calcite (at least for the lex and conformance we use), so I think this query cannot be supported by other DB that uses Calcite as the parser.
   Does it make sense to always quote the identifier for presto connector if presto supports different syntax?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org