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 @@ -1009,10 +1009,10 @@ private Set<String> getTrinoCatalogs(HttpServletRequest request, Map<String, Str
* @return A List of Strings, where each String is the name of the catalog.
*/
private Set<String> getTrinoCatalogsNoCache(HttpServletRequest request, Map<String, String> extraCredentials) {
TableData catalogs = searchAll("select catalog_name FROM system.metadata.catalogs ORDER BY catalog_name", request, extraCredentials, null);
TableData catalogs = searchAll("SHOW CATALOGS", request, extraCredentials, null);
Set<String> catalogSet = new LinkedHashSet<>();
for (Map<String, Object> row : catalogs.getData()) {
String catalog = (String) row.get("catalog_name");
String catalog = (String) row.get("Catalog");
if (applicationConfig.getHiddenCatalogs().contains(catalog.toLowerCase())) {
log.debug("Ignoring catalog {}", catalog);
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ public void getTables_should_returnAnEmptyTableList_when_thereAreNoCatalogs() {
"""
{
"id": "catalog-req-1",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": []
}
"""
Expand All @@ -828,7 +828,7 @@ public void getTablesByCatalogAndSchema_should_linkToTheNextSchema_when_theCatal
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"], ["catalog2"] ]
}
""",
Expand Down Expand Up @@ -887,7 +887,7 @@ public void getTablesByCatalogAndSchema_should_linkToTheFirstSchemaOfTheNextCata
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"], ["catalog2"] ],
"stats": { "state": "FINISHED" }
}
Expand Down Expand Up @@ -955,7 +955,7 @@ public void getTablesByCatalogAndSchema_shouldNot_returnPagination_when_thisIsTh
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"] ]
}
""",
Expand Down Expand Up @@ -1007,7 +1007,7 @@ public void getTablesByCatalogAndSchema_should_throwTrinoNoSuchCatalogException_
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["other_catalog"] ]
}
"""
Expand All @@ -1031,7 +1031,7 @@ public void getTablesByCatalogAndSchema_should_throwTrinoNoSuchCatalogException_
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"] ]
}
""",
Expand Down Expand Up @@ -1063,7 +1063,7 @@ public void getTablesByCatalogAndSchema_should_throwTrinoNoSuchCatalogException_
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"] ]
}
""",
Expand Down Expand Up @@ -1095,7 +1095,7 @@ public void getTablesByCatalogAndSchema_shouldNot_returnPagination_when_theOnlyC
"""
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name",
"columns": [ { "name": "Catalog",
"typeSignature": { "rawType": "varchar" } } ],
"data": [ ["catalog1"] ]
}
Expand Down Expand Up @@ -1232,7 +1232,7 @@ private static String catalogsPage(String... catalogs) {
return """
{
"id": "catalog-req",
"columns": [ { "name": "catalog_name", "typeSignature": { "rawType": "varchar" } } ],
"columns": [ { "name": "Catalog", "typeSignature": { "rawType": "varchar" } } ],
"data": [ %s ],
"stats": { "state": "FINISHED" }
}
Expand Down