Yao-MR commented on code in PR #12048:
URL: https://github.com/apache/gluten/pull/12048#discussion_r3200585202


##########
gluten-substrait/src/main/scala/org/apache/gluten/expression/ExpressionConverter.scala:
##########
@@ -467,6 +467,22 @@ object ExpressionConverter extends SQLConfHelper with 
Logging {
       case s: ScalarSubquery =>
         ScalarSubqueryTransformer(substraitExprName, s)
       case c: Cast =>
+        // Gluten uses session-level timezone for cast. If the per-expression 
timezone
+        // differs from session timezone and the cast involves timestamp type, 
we must
+        // fall back to Spark native execution to ensure correctness.
+        c.timeZoneId.foreach {
+          tz =>
+            val sessionTz = SQLConf.get.sessionLocalTimeZone
+            if (tz != sessionTz) {
+              val involvesTimestamp = c.child.dataType == TimestampType ||
+                c.dataType == TimestampType

Review Comment:
   thanks for review the key point, add other complex types such as ArrayType, 
MapType,StructType,UserDefinedType to recursive detect the timestamp
   



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