comphead commented on code in PR #2115:
URL: https://github.com/apache/datafusion-comet/pull/2115#discussion_r2270213687


##########
spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala:
##########
@@ -2285,15 +2261,31 @@ object QueryPlanSerde extends Logging with 
CometExprShim {
         }
 
       case op =>
-        // Emit warning if:
-        //  1. it is not Spark shuffle operator, which is handled separately
-        //  2. it is not a Comet operator
-        if (!op.nodeName.contains("Comet") && 
!op.isInstanceOf[ShuffleExchangeExec]) {
-          val msg = s"unsupported Spark operator: ${op.nodeName}"
-          emitWarning(msg)
-          withInfo(op, msg)
+        opSerdeMap.get(op.getClass) match {
+          case Some(handler) =>
+            handler.enabledConfig match {
+              case Some(enabledConfig) =>
+                if (!enabledConfig.get(op.conf)) {
+                  withInfo(
+                    op,
+                    s"Native support for operator ${op.getClass.getSimpleName} 
is disabled. " +
+                      s"Set ${enabledConfig.key}=true to enable it.")
+                  return None
+                }
+              case _ =>
+            }

Review Comment:
   ```suggestion
   opSerdeMap.get(op.getClass).foreach { handler =>
     handler.enabledConfig.foreach { cfg =>
       if (!cfg.get(op.conf)) {
         withInfo(
           op,
           s"Native support for operator ${op.getClass.getSimpleName} is 
disabled. " +
             s"Set ${cfg.key}=true to enable it."
         )
         return None
       }
     }
   }
   ```
   
   This probably can be simplified, but I havent' tested the code, just the 
suggestion



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to