HIVE-29819: Fix Iceberg COW UPDATE for null identity partition column filters - #6763
HIVE-29819: Fix Iceberg COW UPDATE for null identity partition column filters#6763kokila-19 wants to merge 1 commit into
Conversation
041239c to
32df432
Compare
32df432 to
a9b8b5f
Compare
|
Before fix: After fix: Tablescan now has str_col partition column in them , so it won't throw error. |
|
@kasakrisz @chinnaraolalam |
| for (Operator<? extends OperatorDesc> child : scanOp.getChildOperators()) { | ||
| if (child instanceof FilterOperator filterOperator) { |
There was a problem hiding this comment.
Could you please verify whether FilterOperator is guaranteed to be a direct child of TS?
There was a problem hiding this comment.
Thanks for telling me this!
Not necessarily, Hive’s PPD code already handles cases where a Select sits between them, so plans like TableScan → Select → Filter are normal. I’ve replaced the direct-child check with a passthrough pipeline walk plus filterExpr handling.
| @@ -0,0 +1,33 @@ | |||
| -- SORT_QUERY_RESULTS | |||
|
|
|||
There was a problem hiding this comment.
Please set
set hive.explain.user=false;
That type of plan has more details.
… filters Column pruning dropped partition columns from the TableScan while filters above the scan still referenced them. Keep filter-referenced partition columns in the Iceberg scan projection.
a9b8b5f to
80f0268
Compare
|



What changes were proposed in this pull request?
Column pruning now keeps Iceberg identity partition columns in the TableScan when a filter uses them.
Before, UPDATE ... WHERE str_col IS NULL could leave str_col in the Filter but remove it from the TableScan.
Now, if a filter references a partition column, that column stays in the scan.
Why are the changes needed?
Iceberg COW UPDATE builds a plan with a Filter above the TableScan. Column pruning was dropping partition columns the Filter still needed causing errors like cannot find field str_col.
The fix keeps the Filter and TableScan aligned on which columns are read.
Does this PR introduce any user-facing change?
User will get error while executing update query with is null predicate in partition column.
It executes successfully after this fix.
How was this patch tested?
qtest: update_iceberg_cow_null_identity_partition.q