You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "piby180 (via GitHub)" <gi...@apache.org> on 2024/09/23 06:28:54 UTC

[I] CAST(col AS STRING) does not work in 1.2.0 anymore [pinot]

piby180 opened a new issue, #14052:
URL: https://github.com/apache/pinot/issues/14052

   CAST(col1 AS STRING) does not work anymore in 1.2.0. It used to work in 1.1.0
   
   SELECT CAST(1.2 AS STRING)
   
   `````
   pinot error: {'errorCode': 720,
    'message': 'QueryPlanningError:\n'
               "Error composing query plan for 'SELECT CAST(1.2 AS STRING)\n"
               "LIMIT 10001': From line 1, column 20 to line 1, column 25: "
               "Unknown identifier 'STRING''\n"
               'org.apache.pinot.query.QueryEnvironment.planQuery(QueryEnvironment.java:136)\n'
               'org.apache.pinot.broker.requesthandler.MultiStageBrokerRequestHandler.handleRequest(MultiStageBrokerRequestHandler.java:158)\n'
               'org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:133)\n'
               'org.apache.pinot.broker.requesthandler.BrokerRequestHandlerDelegate.handleRequest(BrokerRequestHandlerDelegate.java:86)\n'
               'From line 1, column 20 to line 1, column 25: Unknown identifier '
               "'STRING'\n"
               'jdk.internal.reflect.GeneratedConstructorAccessor93.newInstance(Unknown '
               'Source)\n'
               'java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n'
               'java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n'
               'java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n'
               "Unknown identifier 'STRING'\n"
               'jdk.internal.reflect.GeneratedConstructorAccessor92.newInstance(Unknown '
               'Source)\n'
               'java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n'
               'java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n'
               'java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n'}
   ````
   
   CAST(1.2 AS VARCHAR) is working fine. We have to refactor our queries in a couple of services.
   
   Also, can we have documentation on CAST function in pinot docs? It seems to be not there.
   
   Thanks!
   
   


-- 
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.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


Re: [I] CAST(col AS STRING) does not work in 1.2.0 anymore [pinot]

Posted by "piby180 (via GitHub)" <gi...@apache.org>.
piby180 commented on issue #14052:
URL: https://github.com/apache/pinot/issues/14052#issuecomment-2368910683

   @yashmayya Thanks for the link. We might have then confused with single stage query engine. I'll close the issue


-- 
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


Re: [I] CAST(col AS STRING) does not work in 1.2.0 anymore [pinot]

Posted by "piby180 (via GitHub)" <gi...@apache.org>.
piby180 closed issue #14052: CAST(col AS STRING) does not work in 1.2.0 anymore
URL: https://github.com/apache/pinot/issues/14052


-- 
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


Re: [I] CAST(col AS STRING) does not work in 1.2.0 anymore [pinot]

Posted by "yashmayya (via GitHub)" <gi...@apache.org>.
yashmayya commented on issue #14052:
URL: https://github.com/apache/pinot/issues/14052#issuecomment-2367387741

   @piby180 I see the same error on 1.1.0 as well when using the multi-stage query engine:
   
   ```
   ProcessingException(errorCode:150, message:SQLParsingError:
   java.lang.Exception: Unable to find table for this query
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.getMultiStageQueryResponse(PinotQueryResource.java:214)
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.executeSqlQuery(PinotQueryResource.java:177)
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.handlePostSql(PinotQueryResource.java:125)
   	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
   ...
   Caused by: java.lang.RuntimeException: Error composing query plan for: SELECT CAST(1.2 AS STRING) FROM airlineStats;
   	at org.apache.pinot.query.QueryEnvironment.getTableNamesForQuery(QueryEnvironment.java:218)
   	at org.apache.pinot.controller.api.resources.PinotQueryResource.getMultiStageQueryResponse(PinotQueryResource.java:212)
   	... 26 more
   Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 20 to line 1, column 25: Unknown identifier 'STRING'
   	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505)
   ...
   Caused by: org.apache.calcite.sql.validate.SqlValidatorException: Unknown identifier 'STRING'
   	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
   	at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505))
   ```
   
   AFAIK, the multi-stage query engine never supported `STRING` as a valid cast type and it was always `VARCHAR`. This is documented here - https://docs.pinot.apache.org/reference/troubleshooting/troubleshoot-multi-stage-query-engine#different-type-names


-- 
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