You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MERGE INTO pushdown filter is not applied to a table defined with partition transform #10108
Table is defined with partitioned by (hour(data_load_ts)) where data_load_ts is timestamp column.
So, a record with data_load_ts = timestamp '2024-04-04 01:15:53' Iceberg will put it into data_load_ts_hour=2024-04-04-01 partition.
Now, imagine I need to upsert a batch to data_load_ts_hour=2024-04-04-01 partition.
I need to write a query of such:
merge into table as t
from batch as b
on batch.id = table.id and system.hour(table.data_load_ts) = system.hour(timestamp '2024-04-04 01:00:00')
when matched then update *
when not matched then insert *
It's observed in the physical plan that in this case no pushdown filter is applied and iceberg will traverse the whole table.
I actually misread the issue. I think the problem in your case is that are manually comparing the hours. Instead, you should let Iceberg do this for you. Your predicate should be against the timestamp column without the partition transforms.
How the query would look like? So I need to update specific partition and I have a virtual partition hour on date_time_ts.
How would I target that partition?
merge into table as t
from batch as b
on batch.id = table.id and table.data_load_ts = ???????
when matched then update *
when not matched then insert *
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
cc @aokolnychyi@RussellSpitzer Folks can we discuss this issue? It's still clear that joining by actual value of the table partition way worse (performance wise) than specifying the partition manually.
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
Activity
ludlows commentedon Apr 29, 2024
@bk-mz did you solve it ? which version of the spark are you using?
bk-mz commentedon Apr 29, 2024
@ludlows no, we didn't, we have to trim timestamp column to have filters working.
spark 3.5.0
aokolnychyi commentedon Apr 29, 2024
This has been fixed in #9873 but not released yet.
bk-mz commentedon Apr 29, 2024
@aokolnychyi would this fix also work on merge-on-read tables?
aokolnychyi commentedon Apr 29, 2024
I actually misread the issue. I think the problem in your case is that are manually comparing the hours. Instead, you should let Iceberg do this for you. Your predicate should be against the timestamp column without the partition transforms.
bk-mz commentedon Apr 29, 2024
How the query would look like? So I need to update specific partition and I have a virtual partition
hourondate_time_ts.How would I target that partition?
github-actions commentedon Oct 27, 2024
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
bk-mz commentedon Oct 28, 2024
cc @aokolnychyi @RussellSpitzer Folks can we discuss this issue? It's still clear that joining by actual value of the table partition way worse (performance wise) than specifying the partition manually.
github-actions commentedon Apr 27, 2025
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
github-actions commentedon May 11, 2025
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
bk-mz commentedon May 11, 2025
see here: #3607
Pushdown filters are not applicable for tables in Iceberg, instead runtime filters are used after BatchScan
So it's working like that by design.