[
https://issues.apache.org/jira/browse/CALCITE-6463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882634#comment-17882634
]
shiji.mei commented on CALCITE-6463:
------------------------------------
[~rubenql] When I ran this query, the program did not encounter any
exceptions.if you want to reproduce this issue,you can create a TPCH benchmark
and rewriter this query。
> alias generation issue about correlated subquery handling
> ---------------------------------------------------------
>
> Key: CALCITE-6463
> URL: https://issues.apache.org/jira/browse/CALCITE-6463
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.37.0
> Reporter: shiji.mei
> Priority: Major
>
> [dialect|#] is postgresql
> original query:
> {code:sql}
> SELECT MAX(distinct l_orderkey) FROM lineitem where exists( SELECT
> MAX(c_custkey) FROM customer where c_custkey = l_orderkey GROUP BY c_custkey);
> {code}
> Rewritten query:
> {code:sql}
> SELECT MAX("l_orderkey")
> FROM "lineitem"
> WHERE EXISTS (SELECT "c_custkey", MAX("c_custkey")
> FROM "customer"
> WHERE "c_custkey" = "lineitem12"."l_orderkey"
> GROUP BY "c_custkey")
> {code}
> lineitem becomes lineitem12,and it will become a different number every time
> it runs。
> thank you !
--
This message was sent by Atlassian Jira
(v8.20.10#820010)