YannByron commented on code in PR #2437:
URL: https://github.com/apache/fluss/pull/2437#discussion_r2721610942


##########
fluss-spark/fluss-spark-common/src/main/scala/org/apache/fluss/spark/SparkCatalog.scala:
##########
@@ -80,7 +80,28 @@ class SparkCatalog extends TableCatalog with 
SupportsFlussNamespaces with WithFl
   }
 
   override def alterTable(ident: Identifier, changes: TableChange*): Table = {
-    throw new UnsupportedOperationException("Altering table is not supported")
+    if (
+      !changes.forall(
+        e => e.isInstanceOf[TableChange.SetProperty] || 
e.isInstanceOf[TableChange.RemoveProperty])
+    ) {
+      throw new IllegalArgumentException(
+        "Altering table only supports set or remove properties for now")
+    }
+    try {
+      admin
+        .alterTable(toTablePath(ident), 
SparkConversions.toFlussTableChanges(changes).asJava, false)
+        .get()
+      loadTable(ident)
+    } catch {
+      case e: ExecutionException =>
+        if (e.getCause.isInstanceOf[TableNotExistException]) {
+          throw new NoSuchTableException(ident)
+        } else {
+          throw e
+        }
+      case e: UnsupportedOperationException =>
+        throw new IllegalArgumentException(e)

Review Comment:
   Just throw the original `UnsupportedOperationException`.



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