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

Code generated for GROUP BY inside UNION does not compile

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.15.0
    • Fix Version/s: 1.16.0
    • Component/s: None
    • Labels:
      None

      Description

      Hi, Julian Hyde, add these tests in CsvTest

          // fail
          @Test
          public void test0() throws SQLException {
              sql("model", "select count(*) from EMPS group by NAME union select count(*) from EMPS group by NAME").ok();
          }
      
          // fail
          @Test
          public void test1() throws SQLException {
              sql("model", "select sum(AGE) from EMPS group by NAME union select sum(AGE) from EMPS group by NAME").ok();
          }
      
          // this is ok
          @Test
          public void test2() throws SQLException {
              sql("model", "select count(*), NAME from EMPS group by NAME union select count(*), NAME from EMPS group by NAME").ok();
          }
      

      and will throw exception:Caused by: org.codehaus.commons.compiler.CompileException: Line 202, Column 17: No applicable constructor/method found for actual parameters "java.lang.String, java.lang.Integer"; candidates are: "Baz$Record2_1()"

      Hoping for your reply.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              Aron.tao jiatao.tao
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: