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/04/14 00:54:21 UTC

[GitHub] [pinot] amrishlal commented on pull request #8535: add scalar function for cast so it can be calculated at compile time

amrishlal commented on PR #8535:
URL: https://github.com/apache/pinot/pull/8535#issuecomment-1098607748

   Some thoughts:
   1) one option may be to drop the cast function if it is casting something to a numeric type. For example `intColumn > cast(10.3 as long)` could just be rewritten to` intColumn > 10.3` and things would still work fine.
   2) we should probably throw a syntax error if user tries to do something like `intColumn > '12.3'` or `intColumn > cast('10.3' as INT)` (casting a string literal to an int value) and that will encourage the user to write query with proper literal values.
   3) A cast function is probably more useful during run time if for example the user wants to force cast string column values into numerical values (for example `WHERE CAST(stringColumn AS INTEGER) > intColumn`. Otherwise, as far as compile time literals are concerned, it seems like just replacing the CAST function with literal would work? If the literal type is not compatible, then an exception will be thrown which will encourage user to fix the literal in the query?


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