Skip to content

Commit

Permalink
Test if type is null
Browse files Browse the repository at this point in the history
  • Loading branch information
escobargabriel committed Apr 12, 2022
1 parent 1c5ed6e commit 98d4e73
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,10 @@ private int setGetColumnsVectorSchemaRootFromFields(final VectorSchemaRoot curre
}

dataTypeVector.setSafe(insertIndex, SqlTypes.getSqlTypeIdFromArrowType(fieldType));
typeNameVector.setSafe(insertIndex,
columnMetadata.getTypeName().getBytes(StandardCharsets.UTF_8));
byte[] typeName = columnMetadata.getTypeName() != null ?
columnMetadata.getTypeName().getBytes(CHARSET) :
SqlTypes.getSqlTypeNameFromArrowType(fieldType).getBytes(CHARSET);
typeNameVector.setSafe(insertIndex, typeName);

// We're not setting COLUMN_SIZE for ROWID SQL Types, as there's no such Arrow type.
// We're not setting COLUMN_SIZE nor DECIMAL_DIGITS for Float/Double as their precision and scale are variable.
Expand Down

0 comments on commit 98d4e73

Please sign in to comment.