[
https://issues.apache.org/jira/browse/CALCITE-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17818438#comment-17818438
]
Caican Cai edited comment on CALCITE-6272 at 2/19/24 10:13 AM:
---------------------------------------------------------------
[~julianhyde] Hi,I noticed your jira on [distinct|CALCITE-1634 ] processing, I
think this jira can be turned off, should I add distinct test to
ToLogicalConverterTest and modify the jira description.
was (Author: JIRAUSER302115):
[~julianhyde] Hi,I noticed your jira on [distinct|[CALCITE-1634] Make
RelBuilder.distinct no-op if input is already distinct - ASF JIRA (apache.org)]
processing, I think this jira can be turned off, should I add distinct test to
ToLogicalConverterTest and modify the jira description.
> Improved LogicalPlan representation of distinct keyword
> -------------------------------------------------------
>
> Key: CALCITE-6272
> URL: https://issues.apache.org/jira/browse/CALCITE-6272
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.36.0
> Reporter: Caican Cai
> Priority: Minor
> Fix For: 1.37.0
>
>
> In the ToLogicalConvert test, the LogicalPlan parsed with or without the
> distinct keyword is the same. I think this is an improvement.
>
> {code:java}
> @Test void testdistnct() {
> // Equivalent SQL:
> // SELECT DISTINCT *
> // FROM emp
> final RelBuilder builder = builder();
> final RelNode rel =
> builder.scan("EMP")
> .distinct()
> .build();
> String expectedPhysical = ""
> + "EnumerableTableScan(table=[[scott, EMP]])\n";
> String expectedLogical = ""
> + "LogicalTableScan(table=[[scott, EMP]])\n";
> verify(rel, expectedPhysical, expectedLogical);
> }
> @Test void test() {
> // Equivalent SQL:
> // SELECT DISTINCT *
> // FROM emp
> final RelBuilder builder = builder();
> final RelNode rel =
> builder.scan("EMP")
> .build();
> String expectedPhysical = ""
> + "EnumerableTableScan(table=[[scott, EMP]])\n";
> String expectedLogical = ""
> + "LogicalTableScan(table=[[scott, EMP]])\n";
> verify(rel, expectedPhysical, expectedLogical);
> } {code}
> I think it can be improved to something like
> {code:java}
> Logical Project (DISTINCT)
> +- Logical Scan (Table: employees){code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)