KnightChess commented on PR #10389:
URL: https://github.com/apache/hudi/pull/10389#issuecomment-1871693570
And another suggestion: may be we can make csi filter expr compose logical
more clearer. Something like:
```scala
case IsNotNull(attribute: AttributeReference) =>
getTargetIndexedColumnName(attribute, indexSchema)
.map(colName => Or(
LessThan(genColNumNullsExpr(colName), genColValueCountExpr),
IsNull(genColNumNullsExpr(colName))
))
```
the code you fix, is `genColValueCountExpr` will be null, look like
expression `LessThan(leftExpr, rightExpr)` will work well, but we can not
expected the result if we compare a value with null, and the expr is from
spark, so, I think is the following code is be better?
```scala
case IsNotNull(attribute: AttributeReference) =>
getTargetIndexedColumnName(attribute, indexSchema)
.map {colName =>
val numNullExpr = genColNumNullsExpr(colName)
val valueCountExpr = genColValueCountExpr
Or(Or(IsNull(numNullExpr), IsNull(valueCountExpr)),
LessThan(numNullExpr, valueCountExpr))
}
```
Based on this question, other expr like `EqualTo`, `Not`, `In` .... all can
make logical more clearer
--
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]