Skip to content

Commit

Permalink
Fix failures in iceberg cloud tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz-stec authored and hashhar committed Dec 23, 2024
1 parent 5ce80be commit 975e062
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,9 @@ public void testListTables()

try {
SchemaTableName materializedView = new SchemaTableName(ns2, "mv");
catalog.createMaterializedView(
createMaterializedView(
SESSION,
catalog,
materializedView,
someMaterializedView(),
ImmutableMap.of(
Expand Down Expand Up @@ -514,6 +515,24 @@ public void testListTables()
}
}

protected void createMaterializedView(
ConnectorSession session,
TrinoCatalog catalog,
SchemaTableName materializedView,
ConnectorMaterializedViewDefinition materializedViewDefinition,
Map<String, Object> properties,
boolean replace,
boolean ignoreExisting)
{
catalog.createMaterializedView(
session,
materializedView,
materializedViewDefinition,
properties,
replace,
ignoreExisting);
}

protected Optional<SchemaTableName> createExternalIcebergTable(TrinoCatalog catalog, String namespace, AutoCloseableCloser closer)
throws Exception
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import io.trino.spi.connector.CatalogHandle;
import io.trino.spi.connector.ConnectorMaterializedViewDefinition;
import io.trino.spi.connector.ConnectorMetadata;
import io.trino.spi.connector.ConnectorSession;
import io.trino.spi.connector.MaterializedViewNotFoundException;
import io.trino.spi.connector.SchemaTableName;
import io.trino.spi.security.PrincipalType;
Expand Down Expand Up @@ -257,4 +258,26 @@ public void testDefaultLocation()
}
}
}

@Override
protected void createMaterializedView(
ConnectorSession session,
TrinoCatalog catalog,
SchemaTableName materializedView,
ConnectorMaterializedViewDefinition materializedViewDefinition,
Map<String, Object> properties,
boolean replace,
boolean ignoreExisting)
{
catalog.createMaterializedView(
session,
materializedView,
materializedViewDefinition,
ImmutableMap.<String, Object>builder()
.putAll(properties)
.put(LOCATION_PROPERTY, "file:///tmp/a/path/" + materializedView.getTableName())
.buildOrThrow(),
replace,
ignoreExisting);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@ public void testSnowflakeNativeTable()
.hasRootCauseMessage("SQL compilation error:\ninvalid parameter 'table ? is not a Snowflake iceberg table'");
}

@Test
@Override
public void testIcebergTablesFunction()
{
assertThatThrownBy(super::testIcebergTablesFunction)
.hasMessageContaining("schemaPath is not supported for Iceberg snowflake catalog");
}

@Override
protected boolean isFileSorted(Location path, String sortColumnName)
{
Expand Down

0 comments on commit 975e062

Please sign in to comment.