yuqi1129 commented on code in PR #12930:
URL: https://github.com/apache/gravitino/pull/12930#discussion_r3947500690


##########
flink-connector/flink-common/src/main/java/org/apache/gravitino/flink/connector/jdbc/JdbcPropertiesConverter.java:
##########
@@ -59,6 +59,19 @@ public Map<String, String> 
toFlinkCatalogProperties(Map<String, String> gravitin
     // The URL in FlinkJdbcCatalog does not support database and other 
parameters.
     flinkCatalogProperties.put(
         JdbcPropertiesConstants.FLINK_JDBC_URL, 
getBaseUrlFromJdbcUrl(gravitinoJdbcUrl));
+
+    // Default the Flink catalog's 'default-database' option from the 
Gravitino jdbc-database
+    // property when it was not already supplied (e.g. via 
flink.bypass.default-database). This
+    // makes the value available when building per-table scan properties, 
since only the Flink
+    // catalog properties (not the Gravitino table properties) reach 
toFlinkTableProperties, and
+    // 'default-database' -- unlike 'jdbc-database' -- is an option Flink's 
JdbcCatalogFactory
+    // already recognizes, so it survives that factory's strict option 
validation.
+    String gravitinoJdbcDatabase =
+        
gravitinoProperties.get(JdbcPropertiesConstants.GRAVITINO_JDBC_DATABASE);
+    if (gravitinoJdbcDatabase != null) {

Review Comment:
   Better to use StringUtils.isNotBlank



-- 
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]

Reply via email to