[ https://issues.apache.org/jira/browse/CALCITE-6129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mihai Budiu resolved CALCITE-6129. ---------------------------------- Fix Version/s: 1.37.0 Resolution: Fixed Fixed by https://github.com/apache/calcite/commit/3deb77cd6faf811d8a3ca27d6379bd20afb721cf > SqlToRelConverter throws an exception when converting a NULL SqlLiteral > ----------------------------------------------------------------------- > > Key: CALCITE-6129 > URL: https://issues.apache.org/jira/browse/CALCITE-6129 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.36.0 > Reporter: Mihai Budiu > Priority: Minor > Fix For: 1.37.0 > > > The problem is in SqlNodeToRexConverterImpl.convertLiteral. This function > attempts to handle NULL literals differently from all other literals: > {code:java} > final RexBuilder rexBuilder = cx.getRexBuilder(); > if (literal.getValue() == null) { > RelDataType type = cx.getValidator().getValidatedNodeType(literal); > return rexBuilder.makeNullLiteral(type); > } > switch (literal.getTypeName()) { > ... > {code} > 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. -- This message was sent by Atlassian Jira (v8.20.10#820010)