eneskeles commented on PR #2111: URL: https://github.com/apache/iceberg-go/pull/2111#issuecomment-6018303934
> The NULL handling looks right to me. With x = [1, NULL, 2] in one file, Delete(x < 5) drops the NULL row on main and keeps it with this branch, on v2 and v3. > > One thing on the NaN side, which isn't from this PR. With x = [1, NaN, 2], Delete(x < 5) also removes the NaN row, though a scan with x < 5 only returns the other two. Same for x = [10, NaN, 20] with x >= 5, and it happens on main too. It looks like row group pruning: arrow_filter_plan.go runs RewriteNotExpr on the complement filter for the stats check, so it becomes x >= 5 OR x IS NULL. Parquet min/max leave NaN out, so the row group is skipped and its rows never reach the rewritten file. With the stats filter forced to AlwaysTrue locally, all these cases pass. The NaN test here doesn't hit it because its file has values on both sides of 5. > > Since the comment in isNotTrueExpr calls out exactly this NOT(x < 5) vs x >= 5 case, it may be worth covering here or in a follow-up issue. Pushed 31dff2f. The complement filter now became `x >= 5 OR is_nan(x) OR x IS NULL`. I added a test with your cases, where the row group used to be pruned. One side-effect: on float columns, comparison deletes can no longer skip row groups during the rewrite, because Parquet stats can't rule out NaN. Other column types are not affected. I also found a related bug that this PR does not fix: if the user writes the NOT themselves, like `NOT(x < 5)`, a NaN row matches in `[10, NaN, 20]` but not in `[1, NaN, 2]`. It happens with a plain scan too, so I filed #2131 for it. -- 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]
