gianm commented on PR #5349: URL: https://github.com/apache/calcite/pull/5349#issuecomment-6327911892
Some notes about behavior and implementation. In general this patch tries to adhere to GoogleSQL behavior. One thing that was hard to align with GoogleSQL, and remains in this patch, is treatment of aliases in subqueries. In GoogleSQL, `SELECT e.ename FROM (FROM emp AS e)` works fine, but in this implementation, Calcite will reject it. It wasn't obvious how to cleanly get aliases to escape a subquery. Maybe it can be done in a follow-up. I want to call attention to one design decision: the "surrogate SELECT" concept. It's kind of a hybrid of two possible designs: rewriting the parse tree, and validating & converting pipe operators directly. Rewriting the parse tree has issues with achieving the proper behavior around retention of aliases and sort-order. Validating and converting pipe operators directly _could_ work, but I was worried about the extra code it would end up needing. The surrogate SELECT approach gets to leverage a lot of pre-existing code. -- 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]
