Skip to content

Commit

Permalink
Lowercase extra properties
Browse files Browse the repository at this point in the history
Iceberg and Trino properties are all lowercased
  • Loading branch information
sopel39 committed Oct 31, 2024
1 parent 5dbfa3b commit 4475590
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import static com.google.common.base.Preconditions.checkState;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static io.trino.plugin.iceberg.IcebergConfig.FORMAT_VERSION_SUPPORT_MAX;
import static io.trino.plugin.iceberg.IcebergConfig.FORMAT_VERSION_SUPPORT_MIN;
import static io.trino.spi.StandardErrorCode.INVALID_TABLE_PROPERTY;
Expand Down Expand Up @@ -170,7 +171,8 @@ public IcebergTableProperties(
throw new TrinoException(INVALID_TABLE_PROPERTY, format("Extra table property key cannot be null '%s'", extraProperties));
}

return extraProperties;
return extraProperties.entrySet().stream()
.collect(toImmutableMap(entry -> entry.getKey().toLowerCase(ENGLISH), Map.Entry::getValue));
},
value -> value))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8429,7 +8429,7 @@ public void testSystemTables()
public void testExtraProperties()
{
String tableName = "test_create_table_with_multiple_extra_properties_" + randomNameSuffix();
assertUpdate("CREATE TABLE " + tableName + " (c1 integer) WITH (extra_properties = MAP(ARRAY['extra.property.one', 'extra.property.two'], ARRAY['one', 'two']))");
assertUpdate("CREATE TABLE " + tableName + " (c1 integer) WITH (extra_properties = MAP(ARRAY['extra.property.one', 'extra.property.TWO'], ARRAY['one', 'two']))");

assertThat(query("SELECT key, value FROM \"" + tableName + "$properties\" WHERE key IN ('extra.property.one', 'extra.property.two')"))
.skippingTypesCheck()
Expand Down

0 comments on commit 4475590

Please sign in to comment.