Details
-
Task
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
None
Description
A simple test like this (to added in RelBuilderTest), where RelBuilder#field(RexNode e, String name) is called and the first parameter's type is not a struct:
@Test void test() { final RelBuilder builder = RelBuilder.create(config().build()); builder.scan("EMP") .project( builder.field(builder.field("EMPNO"), "abc")) .build(); }
Fails with a NPE:
java.lang.NullPointerException at org.apache.calcite.rel.type.RelDataTypeImpl.getField(RelDataTypeImpl.java:82) at org.apache.calcite.rex.RexBuilder.makeFieldAccess(RexBuilder.java:182) at org.apache.calcite.tools.RelBuilder.field(RelBuilder.java:502)
This situation could be handled with a more gracefully exit (IllegalArgumentException) and a more useful exception message.
Attachments
Issue Links
- links to