-
Notifications
You must be signed in to change notification settings - Fork 3.4k
metadata.catalogs should only list loaded catalogs #26493
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
Conversation
ed011c2 to
309b680
Compare
|
test failure is not related |
kokosing
left a comment
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.
LGTM % comments
| public static Catalog failedCatalog(CatalogName catalogName, CatalogHandle catalogHandle, ConnectorName connectorName) | ||
| { | ||
| return new Catalog(catalogName, catalogHandle, connectorName); | ||
| return new Catalog(catalogName, catalogHandle, connectorName, NOT_LOADED); |
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.
LOAD_FAILED. NOT_LOADED sounds like NOT_YET_LOADED
| String sql = "SELECT DISTINCT connector_name FROM system.metadata.catalogs"; | ||
| List<String> loadedCatalogs = onTrino().executeQuery(sql).column(1).stream().map(Object::toString).collect(toImmutableList()); | ||
| assertThat(configuredConnectors).containsExactlyInAnyOrder(loadedCatalogs.toArray(new String[0])); | ||
| // for now loki connector is not properly loaded, when this is fixed this test will fail |
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.
Please create a ticket or maybe let's remove loki from loading then. Is it used at all?
Nice, that you uncovered an issue.
309b680 to
18ebd4e
Compare
| .map(QueryAssert.Row::row) | ||
| .collect(Collectors.toList())); | ||
| List<String> loadedCatalogs = onTrino().executeQuery(sql).column(1).stream().map(Object::toString).collect(toImmutableList()); | ||
| assertThat(configuredConnectors).containsExactlyInAnyOrder(loadedCatalogs.toArray(new String[0])); |
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.
wrap containsExactlyInAnyOrder on the next line
testing/trino-product-tests/src/main/java/io/trino/tests/product/TestConfiguredFeatures.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/CatalogStatus.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/metadata/CatalogInfo.java
Outdated
Show resolved
Hide resolved
36730e2 to
84e9468
Compare
core/trino-main/src/main/java/io/trino/metadata/CatalogStatus.java
Outdated
Show resolved
Hide resolved
84e9468 to
95fb89a
Compare
| Session session = ((FullConnectorSession) connectorSession).getSession(); | ||
| Builder table = InMemoryRecordSet.builder(CATALOG_TABLE); | ||
| for (CatalogInfo catalogInfo : listCatalogs(session, metadata, accessControl)) { | ||
| List<CatalogInfo> catalogInfos = listCatalogs(session, metadata, accessControl).stream() |
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.
Why not fix listCatalogs instead, what if other place use listCatalogs ?
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 that changing a listCatalogs semantics is pretty fragile. Filtering out on the call site is more explicit about intent
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 that changing a listCatalogs semantics is pretty fragile. Filtering out on the call site is more explicit about intent
Exactly my way of thinking
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.
Can you fix a javadoc for listCatalogs method?
Currently it is:
/**
* Gets all the loaded catalogs
*/
95fb89a to
1044da3
Compare
|
@wendigo can we merge this ? |
|
@homar i'll do a final pass and merge it soon |
1044da3 to
5333a26
Compare
5333a26 to
c3131ce
Compare
c3131ce to
1903eb5
Compare
1903eb5 to
bb19b90
Compare
Description
metadata.catalogs should only list loaded catalogs
Additional context and related issues
Release notes
( ) 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.
(x) Release notes are required, with the following suggested text: