0lai0 commented on code in PR #4693:
URL: https://github.com/apache/datafusion-comet/pull/4693#discussion_r3475213673


##########
spark/src/main/scala/org/apache/comet/serde/datetime.scala:
##########
@@ -711,9 +777,10 @@ object CometDateFormat extends 
CometExpressionSerde[DateFormatClass] {
       case _ => None
     }
 
-    val canUseNative = nativeFormat.isDefined && {
-      isUtc || CometConf.isExprAllowIncompat(getExprConfigName(expr))
-    }
+    val canUseNative = nativeFormat.isDefined &&
+      !expr.children.exists(c => hasNonDefaultStringCollation(c.dataType)) && {

Review Comment:
   Thanks for catching this!! 
   I missed it. The collation check in `canUseNative` was incorrectly blocking 
the native path even when `DateFormatClass.allowIncompatible=true`. 
   
   I removed the guard so that the non-default collation case is now handled by 
`getSupportLevel()` as *Incompatible*. When `allowIncompatible` is false, the 
request still routes through the dispatcher/fallback, but when it is true, the 
native path can be used.
   
   I have also added regression coverage in `CometCollationSuite` for Spark 4.0 
and 4.1 to handle cases involving `date_format` with a collated literal format 
and `DateFormatClass.allowIncompatible=true`.



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