Skip to content
Merged
Show file tree
Hide file tree
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 @@ -125,6 +125,10 @@ public static ColumnIdentity createColumnIdentity(Types.NestedField column)
String name = column.name();
org.apache.iceberg.types.Type fieldType = column.type();

if (fieldType.equals(Types.TimestampType.withZone())) {
throw new UnsupportedOperationException(format("Iceberg column type %s is not supported", fieldType));
}

if (!fieldType.isNestedType()) {
return new ColumnIdentity(id, name, PRIMITIVE, ImmutableList.of());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,16 @@ public void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle
if (!column.isNullable()) {
throw new PrestoException(NOT_SUPPORTED, "This connector does not support add column with non null");
}

org.apache.iceberg.types.Type columnType = toIcebergType(column.getType());

if (columnType.equals(Types.TimestampType.withZone())) {
throw new PrestoException(NOT_SUPPORTED, format("Iceberg column type %s is not supported", columnType));
}

IcebergTableHandle handle = (IcebergTableHandle) tableHandle;
Table icebergTable = getIcebergTable(session, handle.getSchemaTableName());
icebergTable.updateSchema().addColumn(column.getName(), toIcebergType(column.getType()), column.getComment()).commit();
icebergTable.updateSchema().addColumn(column.getName(), columnType, column.getComment()).commit();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ public void testTimestamp()
dropTable(getSession(), "test_timestamp");
}

@Test
public void testTimestampWithTimeZone()
{
assertQueryFails("CREATE TABLE test_timestamp_with_timezone (x timestamp with time zone)", "Iceberg column type timestamptz is not supported");
assertUpdate("CREATE TABLE test_timestamp_with_timezone (x timestamp)");
assertQueryFails("ALTER TABLE test_timestamp_with_timezone ADD COLUMN y timestamp with time zone", "Iceberg column type timestamptz is not supported");
dropTable(getSession(), "test_timestamp_with_timezone");
}

@Test
@Override
public void testDescribeTable()
Expand Down