Copilot commented on code in PR #12444:
URL: https://github.com/apache/gluten/pull/12444#discussion_r3549962451


##########
backends-velox/src-delta40/main/scala/org/apache/spark/sql/delta/GlutenOptimisticTransaction.scala:
##########
@@ -48,6 +48,17 @@ class GlutenOptimisticTransaction(delegate: 
OptimisticTransaction)
       writeOptions: Option[DeltaOptions],
       isOptimize: Boolean,
       additionalConstraints: Seq[Constraint]): Seq[FileAction] = {
+    // Velox cannot write every Spark type: the native write path inserts a 
RowToVeloxColumnarExec
+    // transition whose SparkArrowUtil.toArrowSchema call throws (e.g. 
`Unsupported data type:
+    // variant`) for any type it has no Arrow mapping for. Reuse the backend's 
schema validator so
+    // such writes fall back to the vanilla Delta write path instead of 
failing at runtime.
+    val unsupportedReason = VeloxValidatorApi.validateSchema(inputData.schema)
+    unsupportedReason match {
+      case Some(reason) =>
+        logInfo(s"Schema is not supported by Velox ($reason); falling back to 
the vanilla Delta write path.")
+        return super.writeFiles(inputData, writeOptions, isOptimize, 
additionalConstraints)

Review Comment:
   The new `logInfo` message is long and currently kept on a single line; this 
file typically splits long log strings across lines (see other 
`logInfo`/`logWarning` calls below) and keeping it as-is may trip formatting 
checks or reduce readability. Consider wrapping it similarly.



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