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 @@ -307,6 +307,38 @@ public void testRegisterTableWithMetadataFile()
assertUpdate(format("DROP TABLE %s", tableName));
}

@Test
public void testCreateTableWithTrailingSpaceInLocation()
{
String tableName = "test_create_table_with_trailing_space_" + randomNameSuffix();
String tableLocationWithTrailingSpace = schemaPath() + tableName + " ";

assertQuerySucceeds(format("CREATE TABLE %s WITH (location = '%s') AS SELECT 1 AS a, 'INDIA' AS b, true AS c", tableName, tableLocationWithTrailingSpace));
assertQuery("SELECT * FROM " + tableName, "VALUES (1, 'INDIA', true)");

assertThat(getTableLocation(tableName)).isEqualTo(tableLocationWithTrailingSpace);

assertUpdate("DROP TABLE " + tableName);
}

@Test
public void testRegisterTableWithTrailingSpaceInLocation()
{
String tableName = "test_create_table_with_trailing_space_" + randomNameSuffix();
String tableLocationWithTrailingSpace = schemaPath() + tableName + " ";

assertQuerySucceeds(format("CREATE TABLE %s WITH (location = '%s') AS SELECT 1 AS a, 'INDIA' AS b, true AS c", tableName, tableLocationWithTrailingSpace));

String registeredTableName = "test_register_table_with_trailing_space_" + randomNameSuffix();
assertUpdate(format("CALL system.register_table(CURRENT_SCHEMA, '%s', '%s')", registeredTableName, tableLocationWithTrailingSpace));
assertQuery("SELECT * FROM " + registeredTableName, "VALUES (1, 'INDIA', true)");

assertThat(getTableLocation(registeredTableName)).isEqualTo(tableLocationWithTrailingSpace);

assertUpdate("DROP TABLE " + registeredTableName);
dropTableFromMetastore(tableName);
}

@Test
public void testUnregisterTable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ public void testRegisterTableWithMetadataFile()
.hasMessageContaining("metadata location for register_table is not supported");
}

@Override
Comment thread
ebyhr marked this conversation as resolved.
Outdated
public void testRegisterTableWithTrailingSpaceInLocation()
{
assertThatThrownBy(super::testRegisterTableWithTrailingSpaceInLocation)
.hasMessageContaining("registerTable is not supported for Iceberg REST catalog");
}

@Override
public void testUnregisterTable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
</description>
</property>

<property>
<name>fs.gs.path.encoding</name>
<value>uri-path</value>
<description>
Path codec used that used for decoding and encoding Cloud Storage object
paths. Valid path codecs are `legacy` and `uri-path`.
</description>
</property>

<property>
<name>google.cloud.auth.service.account.enable</name>
<value>true</value>
Expand Down