Skip to content
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

[AMORO-2373] resolve the catalog problem when querying base on kyuubi+flink #2395

Merged
merged 11 commits into from
Dec 21, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,20 @@ public ResultSet executeStatement(String catalog, String statement) {
+ "since it's a hive type catalog and can use spark session catalog, "
+ "switch to spark_catalog before execution",
currentCatalog));
execute("use `spark_catalog`");
try {
connection.setCatalog("spark_catalog");
} catch (SQLException e) {
throw new RuntimeException("error when set catalog: spark_catalog", e);
}
} else {
logs.add(
String.format(
"current catalog is %s, switch to %s before execution", currentCatalog, catalog));
execute("use `" + catalog + "`");
try {
connection.setCatalog(catalog);
} catch (SQLException e) {
throw new RuntimeException("error when set catalog:" + catalog, e);
}
}
this.currentCatalog = catalog;
}
Expand Down