Skip to content

Commit

Permalink
add null type
Browse files Browse the repository at this point in the history
  • Loading branch information
shirly121 committed Jan 6, 2025
1 parent e1f8dd8 commit bb959b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public RelDataType convert(GSDataTypeDesc from) {
Object value;
if ((value = typeMap.get("primitive_type")) != null) {
switch (value.toString()) {
case "DT_NULL":
return typeFactory.createSqlType(SqlTypeName.NULL);
case "DT_ANY":
// any type
return typeFactory.createSqlType(SqlTypeName.ANY);
Expand Down Expand Up @@ -324,6 +326,9 @@ public GSDataTypeDesc convert(RelDataType from) {
SqlTypeName typeName = from.getSqlTypeName();
Map<String, Object> yamlDesc;
switch (typeName) {
case NULL:
yamlDesc = ImmutableMap.of("primitive_type", "DT_NULL");
break;
case INTEGER:
yamlDesc = ImmutableMap.of("primitive_type", "DT_SIGNED_INT32");
break;
Expand Down
1 change: 1 addition & 0 deletions interactive_engine/executor/ir/proto/basic_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum PrimitiveType {
DT_BOOL = 5;
DT_FLOAT = 6;
DT_DOUBLE = 7;
DT_NULL = 8; // denote the type of 'null' value
}

message Decimal { // precision=4 scale=2 : 23.12
Expand Down

0 comments on commit bb959b4

Please sign in to comment.