hqbhoho commented on code in PR #7810:
URL: https://github.com/apache/gravitino/pull/7810#discussion_r2241491116


##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/jdbc/mysql/MySQLPropertyMeta.java:
##########
@@ -79,4 +86,40 @@ public List<PropertyMetadata<?>> getTablePropertyMetadata() {
   public List<PropertyMetadata<?>> getColumnPropertyMetadata() {
     return COLUMN_PROPERTY_META;
   }
+
+  /**
+   * Extract primary key from table properties
+   *
+   * @param tableProperties table properties
+   * @return primary key list
+   */
+  public static Set<String> getPrimaryKey(Map<String, Object> tableProperties) 
{
+    requireNonNull(tableProperties, "tableProperties is null");
+    return ImmutableSet.copyOf((List<String>) 
tableProperties.get(TABLE_PRIMARY_KEY));
+  }
+
+  /**
+   * Extract unique key from table properties
+   *
+   * @param tableProperties table properties
+   * @return unique key list
+   */
+  public static Map<String, Set<String>> getUniqueKey(Map<String, Object> 
tableProperties) {
+    requireNonNull(tableProperties, "tableProperties is null");
+    List<String> uniqueKeyList = (List<String>) 
tableProperties.get(TABLE_UNIQUE_KEY);

Review Comment:
   In the current scenario, this situation will not occur because it will be 
populated by the default value. However, as a generic approach, I will add some 
conditional checks.



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