diqiu50 commented on code in PR #11264:
URL: https://github.com/apache/gravitino/pull/11264#discussion_r3381142591
##########
flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/hive/GravitinoHiveCatalog.java:
##########
@@ -89,6 +97,43 @@ public HiveConf getHiveConf() {
return hiveCatalog.getHiveConf();
}
+ @Override
+ public void open() throws CatalogException {
+ try {
+ applyS3Credential(catalog(), hiveCatalog.getHiveConf());
+ } catch (NoSuchCatalogException e) {
+ LOG.warn(
+ "Catalog '{}' not found in Gravitino during open(); credential
injection skipped."
+ + " This is expected during CREATE CATALOG.",
+ catalogName(),
+ e);
+ }
+ super.open();
+ }
+
+ static void applyS3Credential(Catalog catalog, Configuration conf) {
Review Comment:
The logic is similar but the connector APIs differ (Configuration vs
Map<String, String>), so they can't share the same methoddirectly.
##########
flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/hive/GravitinoHiveCatalog.java:
##########
@@ -89,6 +97,43 @@ public HiveConf getHiveConf() {
return hiveCatalog.getHiveConf();
}
+ @Override
+ public void open() throws CatalogException {
+ try {
+ applyS3Credential(catalog(), hiveCatalog.getHiveConf());
+ } catch (NoSuchCatalogException e) {
+ LOG.warn(
+ "Catalog '{}' not found in Gravitino during open(); credential
injection skipped."
+ + " This is expected during CREATE CATALOG.",
+ catalogName(),
+ e);
+ }
+ super.open();
+ }
+
+ static void applyS3Credential(Catalog catalog, Configuration conf) {
Review Comment:
The logic is similar but the connector APIs differ (Configuration vs
Map<String, String>), so they can't share the same method directly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]