Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.35.0
Description
The following test, when inserted in RelOptRulesTest, crashes at compilation time with an AssertionFailure:
@Test public void testSplit() { final String query = "select split('1|2|3', NULL)"; sql(query) .withFactory( t -> t.withOperatorTable(opTab -> SqlLibraryOperatorTableFactory.INSTANCE.getOperatorTable( SqlLibrary.BIG_QUERY))) // needed for SPLIT function .withRule(CoreRules.PROJECT_REDUCE_EXPRESSIONS) .check(); }
The error message and stack trace look like this:
java.lang.AssertionError: Cannot add expression of different type to set: set type is RecordType(CHAR(5) NOT NULL ARRAY NOT NULL EXPR$0) NOT NULL expression type is RecordType(CHAR(5) NOT NULL ARRAY EXPR$0) NOT NULL set is rel#4:LogicalProject.(input=HepRelVertex#3,exprs=[SPLIT('1|2|3', null:NULL)]) expression is LogicalProject(EXPR$0=[null:CHAR(5) NOT NULL ARRAY]) LogicalValues(tuples=[[{ 0 }]]) Type mismatch: rowtype of original rel: RecordType(CHAR(5) NOT NULL ARRAY NOT NULL EXPR$0) NOT NULL rowtype of new rel: RecordType(CHAR(5) NOT NULL ARRAY EXPR$0) NOT NULL Difference: EXPR$0: CHAR(5) NOT NULL ARRAY NOT NULL -> CHAR(5) NOT NULL ARRAY at org.apache.calcite.plan.RelOptUtil.verifyTypeEquivalence(RelOptUtil.java:394) at org.apache.calcite.plan.hep.HepRuleCall.transformTo(HepRuleCall.java:60)
Attachments
Issue Links
- is related to
-
CALCITE-5580 Add SPLIT function (enabled in BigQuery library)
- Closed
- links to