You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Vladimir Steshin (Jira)" <ji...@apache.org> on 2021/12/08 13:22:00 UTC
[jira] [Commented] (IGNITE-15995) Calcite engine. Order by subquery containing WITH clause failed
[ https://issues.apache.org/jira/browse/IGNITE-15995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17455230#comment-17455230 ]
Vladimir Steshin commented on IGNITE-15995:
-------------------------------------------
As I understand, SqlValidatorImpl#OrderExpressionExpander (extends SqlScopedShuttle) hurries to find the alias in the upper, parent query, whole "select * from ...". But this query and the related namespaces has no such alias. Probably, it's better to search order-by's namespace first.
> Calcite engine. Order by subquery containing WITH clause failed
> ---------------------------------------------------------------
>
> Key: IGNITE-15995
> URL: https://issues.apache.org/jira/browse/IGNITE-15995
> Project: Ignite
> Issue Type: Bug
> Reporter: Aleksey Plekhanov
> Assignee: Vladimir Steshin
> Priority: Minor
> Labels: calcite2-required, calcite3-required
>
> For example:
> {noformat}
> SELECT * FROM (SELECT 1) ORDER BY (WITH t AS (SELECT 1) SELECT * FROM t)
> {noformat}
> Fail with error:
> {noformat}
> Failed to validate query. org.apache.calcite.runtime.CalciteContextException: At line 1, column 58: Column 'T' not found in any table
> {noformat}
> Related tests: {{test_correlated_subquery_cte.test_ignore}}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)