[ https://issues.apache.org/jira/browse/CALCITE-4673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391792#comment-17391792 ]
Julian Hyde commented on CALCITE-4673: -------------------------------------- [~zstan], The problems seem to be related, but your fix only deals with the collection table issue, and that's fine for now. Please log a bug for the remaining issue. Reviewing your change, it would be better if you split your test case into 4 methods, one for each query. The first and second queries seem to fail only when expand=false. The third query seems to pass with or without your fix, whatever the value of expand. The method name "testDeduplicateCorrelationsWithoutWhereClause" doesn't seem to describe what is being tested. You're testing a correlated collection table, right? Move the method closer to {{testCollectionTable}} or {{testCollectionTableWithLateral3}} (added for CALCITE-1732), so that the next maintainer will see the similarity. In the javadoc of your first test method, include the JIRA summary with the JIRA case id. Use \{@code ...} blocks rather than {{<br>}} markers. > Correlate variables deduplication is not triggered when custom table function > presented. > ---------------------------------------------------------------------------------------- > > Key: CALCITE-4673 > URL: https://issues.apache.org/jira/browse/CALCITE-4673 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.27.0 > Reporter: Evgeny Stanilovsky > Assignee: Evgeny Stanilovsky > Priority: Major > Labels: pull-request-available > Fix For: 1.28.0 > > Attachments: code-sample-UDF-in-quidem.patch > > Time Spent: 0.5h > Remaining Estimate: 0h > > request like: > {noformat} > select e.deptno, (select * from lateral table(DEDUP(e.deptno, e.deptno))) > from emp e; > {noformat} > shows 2 different correlates, while it only one. > {noformat} > LogicalProject(DEPTNO=[$7], EXPR$1=[$SCALAR_QUERY({ > LogicalProject(NAME=[$0]) > LogicalTableFunctionScan(invocation=[DEDUP($cor0.DEPTNO, $cor1.DEPTNO)], > rowType=[RecordType(VARCHAR(1024) NAME)]) > })]) > LogicalTableScan(table=[[CATALOG, SALES, EMP]]) > {noformat} > [dev-list > discussion|https://lists.apache.org/thread.html/re20d580a979585ae946d61df80a345c70ae2b5a92577a8b5db1e2c50%40<dev.calcite.apache.org>] -- This message was sent by Atlassian Jira (v8.3.4#803005)