xiangfu0 commented on pull request #7678: URL: https://github.com/apache/pinot/pull/7678#issuecomment-958368030
> I don't think we should introduce `AS` as a transform function. The fix should be purely on the query rewrite. > > `select CAST(runs AS string) as ddd from baseballStats GROUP BY 1` should be rewritten to `select DISTINCT(CAST(runs AS string)) as ddd from baseballStats` instead of `select DISTINCT(CAST(runs AS string) as ddd) from baseballStats`. Notice the place of `as ddd`. > > In fact, `select DISTINCT(CAST(runs AS string) as ddd) from baseballStats` is not a valid SQL query True, I think the tricky case here is that distinct can have multiple arguments, e.g. ``` select CAST(runs AS string) as a, CAST(num AS int) as b from baseballStats GROUP BY 1, 2 ``` -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org