Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4403

AssertionError: Internal error: Conversion to relational algebra failed to preserve datatypes

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 1.5.0
    • 1.16.0
    • Storage - JDBC
    • None

    Description

      select rnum, c1, c2, c3, stddev_pop( c3 ) over(partition by c1) from postgres.public.tolap

      Error: SYSTEM ERROR: AssertionError: Internal error: Conversion to relational algebra failed to preserve datatypes:
      validated type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, INTEGER EXPR$4) NOT NULL
      converted type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, DOUBLE EXPR$4) NOT NULL
      rel:
      LogicalProject(rnum=[$0], c1=[$1], c2=[$2], c3=[$3], EXPR$4=[POWER(/(CastHigh(-(SUM(*(CastHigh($3), CastHigh($3))) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), /(*(SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)))), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), 0.5)])
      LogicalTableScan(table=[[postgres, public, tolap]])

      [Error Id: 61be4aa1-6486-4118-a82b-86c22b551bb5 on centos1:31010]

      (org.apache.drill.exec.work.foreman.ForemanException) Unexpected exception during fragment initialization: Internal error: Conversion to relational algebra failed to preserve datatypes:
      validated type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, INTEGER EXPR$4) NOT NULL
      converted type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, DOUBLE EXPR$4) NOT NULL
      rel:
      LogicalProject(rnum=[$0], c1=[$1], c2=[$2], c3=[$3], EXPR$4=[POWER(/(CastHigh(-(SUM(*(CastHigh($3), CastHigh($3))) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), /(*(SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)))), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), 0.5)])
      LogicalTableScan(table=[[postgres, public, tolap]])

      org.apache.drill.exec.work.foreman.Foreman.run():261
      java.util.concurrent.ThreadPoolExecutor.runWorker():1142
      java.util.concurrent.ThreadPoolExecutor$Worker.run():617
      java.lang.Thread.run():745
      Caused By (java.lang.AssertionError) Internal error: Conversion to relational algebra failed to preserve datatypes:
      validated type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, INTEGER EXPR$4) NOT NULL
      converted type:
      RecordType(INTEGER NOT NULL rnum, CHAR(3) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c1, CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" c2, INTEGER c3, DOUBLE EXPR$4) NOT NULL
      rel:
      LogicalProject(rnum=[$0], c1=[$1], c2=[$2], c3=[$3], EXPR$4=[POWER(/(CastHigh(-(SUM(*(CastHigh($3), CastHigh($3))) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), /(*(SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), SUM(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)))), COUNT(CastHigh($3)) OVER (PARTITION BY $1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)), 0.5)])
      LogicalTableScan(table=[[postgres, public, tolap]])

      org.apache.calcite.util.Util.newInternal():777
      org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType():435
      org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery():541
      org.apache.calcite.prepare.PlannerImpl.convert():214
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToRel():471
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.validateAndConvert():201
      org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():167
      org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():199
      org.apache.drill.exec.work.foreman.Foreman.runSQL():924
      org.apache.drill.exec.work.foreman.Foreman.run():250
      java.util.concurrent.ThreadPoolExecutor.runWorker():1142
      java.util.concurrent.ThreadPoolExecutor$Worker.run():617
      java.lang.Thread.run():745

      SQLState: null
      ErrorCode: 0

      create table TOLAP (RNUM integer not null , C1 char(3), C2 char(2), C3 integer, C4 integer);

      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 0, 'AAA', 'AA', 10, 3);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 1, 'AAA', 'AA', 15, 2);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 2, 'AAA', 'AB', 25, 1);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 3, 'BBB', 'BB', 20, 5);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 4, 'CCC', 'CC', 30, 2);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 5, 'DDD', 'DD', 40, 1);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 6, NULL, NULL, 50, 6);
      insert into TOLAP (RNUM, C1, C2, C3, C4) values ( 7, NULL, NULL, NULL, NULL);

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dr-wolf Taras Supyk
            the6campbells N Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment