Add connector test for materialized view#8117
Conversation
plugin/trino-hive/src/test/java/io/trino/plugin/hive/TestHiveConnectorSmokeTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
should return materialised view, as it's also a view
I don't think we have established what is the right behaviour here
We might want to list MVs in another metadata table instead of listing in information_schema.views
There was a problem hiding this comment.
// TODO should probably return materialized view, as it's also a view -- to be double checked
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorSmokeTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorSmokeTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/TestIcebergConnectorSmokeTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
We can also add system.jdbc tests similar to https://github.com/trinodb/trino/pull/8113/files#diff-6f73e014ee92e4e98ff14049eaa094585b893d44d7ee942a4c5a32deee15d836R129
There was a problem hiding this comment.
awesome, however, i would prefer to have this tested end-to-end via java.sql.DatabaseMetadata.
it then is kind of cumbersome as a connector test
@raunaqmorarka can you please file an issue to have DatabaseMetadata tested with MVs?
There was a problem hiding this comment.
side note: do we want that check actually?
There was a problem hiding this comment.
@losipiuk removed for now. I think it's default IDE's behavior, so if we want to ignore it, we should document that in DEVELOP*.md
There was a problem hiding this comment.
@raunaqmorarka is there an issue for fix Iceberg MV reporting?
There was a problem hiding this comment.
BTW Do we have any roadmap issue for materialized views?
There was a problem hiding this comment.
I already have a fix for iceberg information_schema.tables listing in 5fff606
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorSmokeTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
also add a test which filters byt type expecting VIEW or MATERIALIZED VIEW depending on what we settle on.
Or assert on type.
There was a problem hiding this comment.
@losipiuk i think we didn't settle on this yet, but that's a very good idea.
for now will have assertion like this:
.containsAll("VALUES ('" + viewName + "', 'BASE TABLE')"); // TODO table_type should probably be "* VIEW"
losipiuk
left a comment
There was a problem hiding this comment.
Thanks.
Nice to have as a base for further work on MVs.
|
ac |
|
https://github.com/trinodb/trino/runs/2693225647 cc @kokosing |
|
It turns out Accumulo supports views, but its tests were lying it does not. |
This also improves connector tests for view.
| @Override | ||
| public void testShowCreateTable() | ||
| { | ||
| assertThat((String) computeScalar("SHOW CREATE TABLE region")) |
There was a problem hiding this comment.
nit: cast to string is not needed
There was a problem hiding this comment.
indeed, but may help completion. i will keep for now, but we can remove as followup
| @Override | ||
| public void testShowCreateTable() | ||
| { | ||
| assertThat((String) computeScalar("SHOW CREATE TABLE region")) |
There was a problem hiding this comment.
nit: cast to string is not needed
This also improves connector tests for view.
cc @martint @raunaqmorarka @sopel39 @hashhar @wendigo
relates to https://trinodb.slack.com/archives/C01UM2VGMC3/p1622015285003600, https://trinodb.slack.com/archives/C01UM2VGMC3/p1619625097028600