Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions service/src/java/org/apache/hive/service/cli/TableSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public TableSchema(TTableSchema tTableSchema) {

public TableSchema(List<FieldSchema> fieldSchemas) {
int pos = 1;
if (fieldSchemas == null) {
return;
}
for (FieldSchema field : fieldSchemas) {
columns.add(new ColumnDescriptor(field.getName(), field.getComment(), new TypeDescriptor(
field.getType()), pos++));
Expand Down Expand Up @@ -78,6 +81,7 @@ public void clear() {

public TTableSchema toTTableSchema() {
TTableSchema tTableSchema = new TTableSchema();
tTableSchema.setColumns(new ArrayList<>());
for (ColumnDescriptor col : columns) {
tTableSchema.addToColumns(col.toTColumnDesc());
}
Expand Down
Loading