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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/BaseHoodieCatalystExpressionUtils.scala:
##########
@@ -111,5 +113,21 @@ abstract class BaseHoodieCatalystExpressionUtils extends 
HoodieCatalystExpressio
         }
       }
     }
+
+    // Negative factors reverse the ordering and zero collapses it. 
Non-literal factors are not
+    // matched since the optimizer folds constant factors to literals before 
data skipping runs
+    private def isPositiveNumericLiteral(expr: Expression): Boolean = expr 
match {
+      case Literal(value, _) => value match {
+        case b: Byte => b > 0
+        case s: Short => s > 0
+        case i: Int => i > 0
+        case l: Long => l > 0
+        case f: Float => f > 0
+        case d: Double => d > 0

Review Comment:
   Very good catch.
   
   Fixed: `Float`/`Double` factors must also be finite. Added a pruning repro 
(`CAST(A AS DOUBLE) * Infinity <= Infinity` over `A` in `[0, 1]`, which pruned 
the file before) plus matcher cases for `Multiply` and `Divide`.
   



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