voonhous commented on code in PR #20524:
URL: https://github.com/apache/hudi/pull/20524#discussion_r4475503799


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/dataskipping/rules/CastRule.scala:
##########
@@ -77,4 +80,13 @@ object HoodieSparkTypeUtils {
 
       case _ => true
     }
+
+  override def steps(term: Expression): Seq[Step] = term match {
+    // NOTE: Some casts (for ex, string to date in non-ANSI mode) return NULL 
on malformed input;
+    //       `partial` is left false for now, as it has no behavioral effect 
yet
+    case cast @ Cast(child, _, _, _) if preservesOrder(cast.child.dataType, 
cast.dataType) =>

Review Comment:
   Done, I used a different check. `child.resolved` is stricter than master. In 
expression index mode, master ranges children that are unresolved but typed. 
e.g. `to_date(s)` before the analyzer sets its time zone, and the "golden" run 
falgged those outputs changing. 
   
   The guard is now `Try(child.dataType).isSuccess`, which only rejects 
children, e.g. unknown functions.



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

Reply via email to