FANNG1 commented on code in PR #6543:
URL: https://github.com/apache/gravitino/pull/6543#discussion_r1992608604


##########
flink-connector/flink/src/main/java/org/apache/gravitino/flink/connector/catalog/BaseCatalogFactory.java:
##########
@@ -45,7 +46,7 @@ public interface BaseCatalogFactory extends CatalogFactory {
    *
    * @return The requested property converter.
    */
-  PropertiesConverter propertiesConverter();
+  PropertiesConverter propertiesConverter(Map<String, String> catalogOptions);

Review Comment:
   please add Java doc and explain what is it and why add this parameters.



##########
flink-connector/flink/src/main/java/org/apache/gravitino/flink/connector/jdbc/JdbcPropertiesConstants.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.flink.connector.jdbc;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class JdbcPropertiesConstants {
+
+  private JdbcPropertiesConstants() {}
+
+  public static final String GRAVITINO_JDBC_USER = "jdbc-user";
+  public static final String GRAVITINO_JDBC_PASSWORD = "jdbc-password";
+  public static final String GRAVITINO_JDBC_URL = "jdbc-url";
+  public static final String GRAVITINO_JDBC_DRIVER = "jdbc-driver";

Review Comment:
   Flink jdbc catalog doesn't support setting driver in catalog options but 
support in table options, the above configuration is for table not catalog.



##########
flink-connector/flink/src/main/java/org/apache/gravitino/flink/connector/PropertiesConverter.java:
##########
@@ -136,7 +137,8 @@ default Map<String, String> 
toFlinkDatabaseProperties(Map<String, String> gravit
    * @param gravitinoProperties The table properties provided by Gravitino.
    * @return The table properties for the Flink connector.
    */
-  default Map<String, String> toFlinkTableProperties(Map<String, String> 
gravitinoProperties) {
+  default Map<String, String> toFlinkTableProperties(

Review Comment:
   could you add `tablePath` to Java doc and explain why add this parameters?



##########
flink-connector/flink/src/main/java/org/apache/gravitino/flink/connector/jdbc/JdbcPropertiesConstants.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.gravitino.flink.connector.jdbc;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class JdbcPropertiesConstants {
+
+  private JdbcPropertiesConstants() {}
+
+  public static final String GRAVITINO_JDBC_USER = "jdbc-user";
+  public static final String GRAVITINO_JDBC_PASSWORD = "jdbc-password";
+  public static final String GRAVITINO_JDBC_URL = "jdbc-url";
+  public static final String GRAVITINO_JDBC_DRIVER = "jdbc-driver";
+  public static final String GRAVITINO_JDBC_DEFAULT_DATABASE = 
"flink.bypass.default-database";
+
+  public static final String FLINK_JDBC_URL = "base-url";
+  public static final String FLINK_JDBC_USER = "username";
+  public static final String FLINK_JDBC_PASSWORD = "password";
+  public static final String FLINK_JDBC_DEFAULT_DATABASE = "default-database";
+
+  public static Map<String, String> flinkToGravitinoMap = new HashMap<>();
+  public static Map<String, String> gravitinoToFlinkMap = new HashMap<>();
+
+  static {
+    flinkToGravitinoMap.put(FLINK_JDBC_URL, GRAVITINO_JDBC_URL);
+    flinkToGravitinoMap.put(FLINK_JDBC_USER, GRAVITINO_JDBC_USER);
+    flinkToGravitinoMap.put(FLINK_JDBC_PASSWORD, GRAVITINO_JDBC_PASSWORD);
+    flinkToGravitinoMap.put(FLINK_JDBC_DEFAULT_DATABASE, 
GRAVITINO_JDBC_DEFAULT_DATABASE);

Review Comment:
   no need to transform `FLINK_JDBC_DEFAULT_DATABASE` between 
`GRAVITINO_JDBC_DEFAULT_DATABASE`, Flink properties converter will do it 
automaticly. 



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