shenyu0127 commented on issue #9504: URL: https://github.com/apache/pinot/issues/9504#issuecomment-1528187122
This bug means a feature request: we need to add a new type `timestamp` to `Literal` in the [query.thrift](https://github.com/apache/pinot/blob/2bcf592d433241b07dcaac82833df4b225617410/pinot-common/src/thrift/query.thrift#L70). We get an error in query `select cast(cast ('2023-01-01 00:00:00' as timestamp) as long) from Table`. This is because the inner `cast` returns a `Literal` of type `String` ([here](https://github.com/apache/pinot/blob/2bcf592d433241b07dcaac82833df4b225617410/pinot-common/src/main/java/org/apache/pinot/sql/parsers/rewriter/CompileTimeFunctionsInvoker.java#L89) the `getLiteralExpression` function takes a `Timestamp` object and returns a `Literal` of type `String`), which cannot be cast to type `long`. The same bug was also reported in https://github.com/apache/pinot/issues/9853 and @Jackie-Jiang identified the missing feature. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
