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: Resolved
    • Major
    • Resolution: Fixed
    • 1.37.0
    • 1.39.0
    • core
    • jvm: open-jdk11

    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:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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