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

Alias within GroupingSets throws type mis-match exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.29.0
    • 1.31.0
    • core
    • jdk8

    Description

      @Test void testAliasWithinGroupingSets() {
        final String sql = "SELECT empno / 2 AS x\n"
            + "FROM emp\n"
            + "GROUP BY ROLLUP(x)";
        sql(sql)
            .withConformance(SqlConformanceEnum.LENIENT)
            .ok();
      }

      the above test throws

      Conversion to relational algebra failed to preserve datatypes:
      validated type:
      RecordType(INTEGER NOT NULL X) NOT NULL
      converted type:
      RecordType(INTEGER X) NOT NULL

      The X has lost its NOT NULL constraints.

      Attachments

        Issue Links

          Activity

            People

              yanjing.wang yanjing.wang
              yanjing.wang yanjing.wang
              Votes:
              0 Vote for this issue
              Watchers:
              6 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