Description
The problem is in SqlNodeToRexConverterImpl.convertLiteral. This function attempts to handle NULL literals differently from all other literals:
final RexBuilder rexBuilder = cx.getRexBuilder(); if (literal.getValue() == null) { RelDataType type = cx.getValidator().getValidatedNodeType(literal); return rexBuilder.makeNullLiteral(type); } switch (literal.getTypeName()) { ...
However, such a literal does not have a validated data type, so getValidatedNodeType will throw Util.needToImplement.
The solution would be to handle NULL literals like all other literals and create a literal with a NULL type.
Attachments
Issue Links
- is part of
-
CALCITE-6192 DEFAULT expression with NULL value throws unexpected exception
- Closed