abhishekagarwal87 commented on a change in pull request #12092:
URL: https://github.com/apache/druid/pull/12092#discussion_r782781872
##########
File path: sql/src/main/java/org/apache/druid/sql/calcite/planner/Calcites.java
##########
@@ -173,6 +173,8 @@ public static ColumnType
getValueTypeForRelDataTypeFull(final RelDataType type)
return ColumnType.LONG_ARRAY;
}
return ColumnType.STRING_ARRAY;
+ } else if (sqlTypeName == SqlTypeName.NULL) {
+ return ColumnType.STRING;
Review comment:
```
org.apache.druid.java.util.common.ISE: Cannot translate sqlTypeName[NULL] to
Druid type for field[EXPR$0]
at
org.apache.druid.sql.calcite.table.RowSignatures.fromRelDataType(RowSignatures.java:68)
at
org.apache.druid.sql.calcite.rule.DruidLogicalValuesRule.onMatch(DruidLogicalValuesRule.java:75)
at
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208)
```
We want to build the DruidTable object with a valid RowSignature from the
inline datasource. RowSignature needs a non-null column type for each column.
When there is just row with null value in the inline data, the sql type is
null. When we don't have a corresponding druid column type, we throw the above
exception.
Instead of introducing a new column type, I have mapped the null type to
string type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]