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 @@ -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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snowflake catalog supports iceberg_tables function, right? Skipping the entire test doesn't make sense to me. We could run this function without additional schema creation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebyhr Right, I did it quickly so the CI would be green + it follows a pattern in this test class.
I submitted a new PR that actually tests this for the snowflake catalog. PTAL

}

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