[ 
https://issues.apache.org/jira/browse/CALCITE-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17818595#comment-17818595
 ] 

Julian Hyde commented on CALCITE-6272:
--------------------------------------

I think you’re saying the current behavior is fine, and you want to add tests. 
I believe the current behavior is fine and we probably don’t need any more 
tests. 

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

Reply via email to