yashmayya opened a new pull request, #13664: URL: https://github.com/apache/pinot/pull/13664
- Currently, a query like `WITH tmp AS (SELECT * FROM a LIMIT 1), tmp AS (SELECT * FROM a LIMIT 2) SELECT * FROM tmp` doesn't return an error and runs fine. - By default, Calcite just uses the last CTE for the alias in such cases. However, this can lead to confusing and unexpected results in case there was a human error while writing a complex query with many CTEs. - In databases like Postgres and MySQL too, such queries return a clear error. - Postgres: ``` ERROR: WITH query name "tmp" specified more than once ``` - MySQL: ``` ERROR 1066 (42000): Not unique table/alias: 'tmp' ``` - Pinot (after this patch): ``` Duplicate alias in WITH: 'tmp' ``` -- 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]
