zhztheplayer commented on code in PR #12024:
URL: https://github.com/apache/gluten/pull/12024#discussion_r3201644604


##########
backends-velox/src-delta33/main/scala/org/apache/spark/sql/execution/datasources/v2/OffloadDeltaCommand.scala:
##########
@@ -45,4 +50,20 @@ case class OffloadDeltaCommand() extends OffloadSingleNode {
       case other => other
     }
   }
+
+  private def shouldOffloadOptimize(optimize: OptimizeTableCommand): Boolean = 
{
+    optimize.zOrderBy.isEmpty &&
+    optimize.optimizeContext.reorg.isEmpty &&
+    !optimize.optimizeContext.isFull &&
+    !isClusteredOptimize(optimize)
+  }
+
+  private def isClusteredOptimize(optimize: OptimizeTableCommand): Boolean = {
+    try {
+      val snapshot = getDeltaTable(optimize.child, "OPTIMIZE").update()
+      ClusteredTableUtils.isSupported(snapshot.protocol)
+    } catch {
+      case NonFatal(_) => true

Review Comment:
   Which exception is thrown here?



##########
backends-velox/src-delta33/main/scala/org/apache/spark/sql/execution/datasources/v2/OffloadDeltaCommand.scala:
##########
@@ -45,4 +50,20 @@ case class OffloadDeltaCommand() extends OffloadSingleNode {
       case other => other
     }
   }
+
+  private def shouldOffloadOptimize(optimize: OptimizeTableCommand): Boolean = 
{
+    optimize.zOrderBy.isEmpty &&
+    optimize.optimizeContext.reorg.isEmpty &&
+    !optimize.optimizeContext.isFull &&
+    !isClusteredOptimize(optimize)
+  }

Review Comment:
   Can we add comment to this method?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to