Skip to content

Commit

Permalink
Test iceberg_tables function with TrinoSnowflakeCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stec committed Dec 30, 2024
1 parent 4d76f58 commit 181dc8c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import static io.trino.plugin.iceberg.catalog.snowflake.TestingSnowflakeServer.TableType.NATIVE;
import static io.trino.testing.TestingProperties.requiredNonEmptySystemProperty;
import static java.util.Locale.ENGLISH;
import static java.util.stream.Collectors.joining;
import static org.apache.iceberg.FileFormat.PARQUET;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down Expand Up @@ -688,8 +689,12 @@ public void testSnowflakeNativeTable()
@Override
public void testIcebergTablesFunction()
{
assertThatThrownBy(super::testIcebergTablesFunction)
.hasMessageContaining("schemaPath is not supported for Iceberg snowflake catalog");
String schemaTablesValues = "VALUES " + getQueryRunner()
.execute("SELECT table_schema, table_name FROM iceberg.information_schema.tables WHERE table_schema='%s'".formatted(SNOWFLAKE_TEST_SCHEMA.toLowerCase(ENGLISH)))
.getMaterializedRows().stream()
.map(row -> "('%s', '%s')".formatted(row.getField(0), row.getField(1)))
.collect(joining(", "));
assertQuery("SELECT * FROM TABLE(iceberg.system.iceberg_tables(SCHEMA_NAME => '%s'))".formatted(SNOWFLAKE_TEST_SCHEMA.toLowerCase(ENGLISH)), schemaTablesValues);
}

@Override
Expand Down

0 comments on commit 181dc8c

Please sign in to comment.