You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/04/05 16:32:20 UTC

[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #5224: [HUDI-3739][Stacked on 5208] Fix handling of the `isNotNull` predicate in Data Skipping

alexeykudinkin commented on code in PR #5224:
URL: https://github.com/apache/hudi/pull/5224#discussion_r843030033


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/DataSkippingUtils.scala:
##########
@@ -211,10 +211,10 @@ object DataSkippingUtils extends Logging {
           .map(colName => GreaterThan(genColNumNullsExpr(colName), Literal(0)))
 
       // Filter "colA is not null"
-      // Translates to "colA_nullCount = 0" for index lookup
+      // Translates to "colA_nullCount < colA_valueCount" for index lookup
       case IsNotNull(attribute: AttributeReference) =>
         getTargetIndexedColumnName(attribute, indexSchema)
-          .map(colName => EqualTo(genColNumNullsExpr(colName), Literal(0)))
+          .map(colName => LessThan(genColNumNullsExpr(colName), genColValueCountExpr))

Review Comment:
   Ha! Great question. 
   
   The reason is logical fallacy: "colA is not null" != "there is no null in colA", instead it's "colA contains non-null" (you can check out some other expressions, there are many expressions in this list that carry such properties):
   
    - "is null" means that the column has to contain null values (ie `nullCount` > 0)
    - "is not null" means that the column has to contain non-null values (ie `nullCount` < `valueCount`)



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org