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


##########
catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueCatalogOperations.java:
##########
@@ -679,25 +732,29 @@ private TableInput buildTableInput(
       if (key.startsWith(GlueConstants.SERDE_PARAMETER_PREFIX)) {
         serdeParams.put(
             key.substring(GlueConstants.SERDE_PARAMETER_PREFIX.length()), 
entry.getValue());
-      } else if (!SD_TABLE_PROPERTY_KEYS.contains(key) && 
!TABLE_LEVEL_KEYS.contains(key)) {
+      } else if (!SD_TABLE_PROPERTY_KEYS.contains(key)) {
         tableParams.put(key, entry.getValue());
       }
     }
 
-    // Translate format name to input/output/serde class names if not 
explicitly set
-    String format = properties.get(GlueConstants.FORMAT);
+    // Translate format name to input/output/serde class names if not 
explicitly set.
+    String format = properties.getOrDefault(GlueConstants.FORMAT, 
StorageFormat.PARQUET.name());
     String inputFormat = properties.get(GlueConstants.INPUT_FORMAT_CLASS);
     String outputFormat = properties.get(GlueConstants.OUTPUT_FORMAT);
     String serdeLib = properties.get(GlueConstants.SERDE_LIB);
 
-    if (inputFormat == null && format != null) {
-      inputFormat = getInputFormatClass(format.toLowerCase(Locale.ROOT));
-    }
-    if (outputFormat == null && format != null) {
-      outputFormat = getOutputFormatClass(format.toLowerCase(Locale.ROOT));
-    }
-    if (serdeLib == null && format != null) {
-      serdeLib = getSerdeClass(format.toLowerCase(Locale.ROOT));
+    boolean needsFormatClasses =
+        !isIceberg && (inputFormat == null || outputFormat == null || serdeLib 
== null);
+    if (needsFormatClasses) {
+      StorageFormat sf;
+      try {
+        sf = StorageFormat.valueOf(format.toUpperCase(Locale.ROOT));
+      } catch (IllegalArgumentException e) {
+        throw new IllegalArgumentException("Unsupported table format: " + 
format);

Review Comment:
   No need to catch this exception.



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