Zouxxyy commented on code in PR #10900:
URL: 
https://github.com/apache/incubator-gluten/pull/10900#discussion_r2446868970


##########
gluten-iceberg/src/main/scala/org/apache/iceberg/spark/source/IcebergWriteUtil.scala:
##########
@@ -27,8 +28,8 @@ import org.apache.iceberg.types.Types.{ListType, MapType}
 
 object IcebergWriteUtil {
 
-  def isDataWrite(write: Write): Boolean = {
-    write.isInstanceOf[SparkWrite]
+  def supportsWrite(write: Write): Boolean = {
+    SparkReflectionUtil.isInstanceOfClassName(write, 
"org.apache.iceberg.spark.source.SparkWrite")

Review Comment:
   For example, if a user downloads a bundled Gluten package that includes the 
Iceberg module, but their runtime environment does not have Iceberg, then if  
we keep use `write.isInstanceOf[SparkWrite]`,  below will  throw an class not 
found exception:
   
   `Case a: AppendDataExec if supportsWrite(a.write) =>`
   
   like what we do in offload scan: 
https://github.com/apache/incubator-gluten/blob/71bcdb5b14858a25d860cfd819131c4888384994/gluten-paimon/src-paimon/main/scala/org/apache/gluten/execution/OffloadPaimonScan.scala#L26



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