Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4512

GROUP BY expression with argument name same with SELECT field and alias causes validation error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.26.0
    • None
    • core
    • jvm: open-jdk8

    Description

      String sql = "select replace(name, 'a', 'b') as name from users group by replace(name, 'a', 'b')";
      

       

      when group by expression has argument name same with select list item alias, the group by argument will be expanded to select list item when sql conformance supports 'groupByAlias', so the above sql will be expanded to 

      String sql = "select replace(name, 'a', 'b') as name from users group by replace(replace(name, 'a', 'b'), 'a', 'b')";
      

       

      this is unexpected.

      Attachments

        Issue Links

          Activity

            People

              yanjing.wang yanjing.wang
              yanjing.wang yanjing.wang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h