-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test iceberg_tables function with TrinoSnowflakeCatalog #24593
base: master
Are you sure you want to change the base?
Test iceberg_tables function with TrinoSnowflakeCatalog #24593
Conversation
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test is flaky. What happens if a new object is created after listing iceberg.information_schema.tables
and before executing iceberg_tables
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the reason the generic test creates its own schemas but in this case, it is not needed because this test does not create iceberg tables other than potentially during setup.
There is one test that creates a native table but that will not be listed by TrinoSnowflakeCatalog#listTables
@ebyhr could you run with secrets to actually run this test? |
/test-with-secrets sha=181dc8c8651fdc68b83c9d3d520ef87e13a3f6b7 |
The CI workflow run with tests that require additional secrets has been started: https://github.com/trinodb/trino/actions/runs/12583104964 |
Description
Implement a simple test for the
system.iceberg_tables table
function for theTrinoSnowflakeCatalog
.Since
TrinoSnowflakeCatalog
is read only the original generic test does not work.Theoretically, we could apply the modifications directly on the snowflake to match the generic test with multiple schemas. However, that seems like an overkill given the implementation just delegates to the
listTables
method and maps the results.Additional context and related issues
Release notes
( X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: