Dwrite opened a new pull request, #5346:
URL: https://github.com/apache/calcite/pull/5346

   Allow top-level explicit table, "TABLE t [ORDER BY ...]"
   
   "TABLE t" is equivalent to "SELECT * FROM t" and was already accepted
   inside a FROM clause, but a top-level "TABLE emp" failed with
   UnsupportedOperationException, and "TABLE emp ORDER BY deptno" failed
   in performUnconditionalRewrites. There were two causes:
   
   * performUnconditionalRewrites replaces the top-level "TABLE t" with a
     new SELECT, so the type was registered only for the new node, while
     Prepare asks for the type of the original node. SqlValidatorImpl.validate
     now also registers the type for the original node when the top node
     was rewritten.
   * When the query of an ORDER BY is rewritten to a new node,
     performUnconditionalRewrites called SqlCall.setOperand, which
     SqlOrderBy does not support. It now rebuilds the SqlOrderBy instead.
   
   Add tests in JdbcTest.


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

Reply via email to