Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,22 @@ public static List<Column> toHiveColumns(List<NestedField> columns)
return columns.stream()
.map(column -> new Column(
column.name(),
HiveType.toHiveType(HiveSchemaUtil.convert(column.type())),
icebergTypeToHiveType(column.type()),
Optional.empty(),
Optional.empty()))
.collect(toImmutableList());
}

private static HiveType icebergTypeToHiveType(org.apache.iceberg.types.Type icebergType)
{
// Special handling for TIME type: use bigint instead of 'string'
if (icebergType.typeId() == org.apache.iceberg.types.Type.TypeID.TIME) {
return HiveType.HIVE_LONG;
}

return HiveType.toHiveType(HiveSchemaUtil.convert(icebergType));
}

public static FileFormat getFileFormat(Table table)
{
return FileFormat.valueOf(table.properties()
Expand Down
Loading