You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "bk-mz (via GitHub)" <gi...@apache.org> on 2024/04/09 08:05:51 UTC
[I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
bk-mz opened a new issue, #10108:
URL: https://github.com/apache/iceberg/issues/10108
### Apache Iceberg version
1.4.2
### Query engine
Spark
### Please describe the bug 🐞
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.
```
+- BatchScan glue.prod.table[id#1938, data_load_ts#1959, _file#1962, _pos#1963L, _spec_id#1960, _partition#1961] glue.prod.table (branch=null) [filters=, groupedBy=] RuntimeFilters: []
```
Is there any way to somehow ask iceberg not to traverse the whole table?
--
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: issues-unsubscribe@iceberg.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "aokolnychyi (via GitHub)" <gi...@apache.org>.
aokolnychyi commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2083301209
This has been fixed in https://github.com/apache/iceberg/pull/9873 but not released yet.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2832810877
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.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "aokolnychyi (via GitHub)" <gi...@apache.org>.
aokolnychyi commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2083513259
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.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "ludlows (via GitHub)" <gi...@apache.org>.
ludlows commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2082184500
@bk-mz did you solve it ? which version of the spark are you using?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "bk-mz (via GitHub)" <gi...@apache.org>.
bk-mz commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2083533939
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 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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #10108: MERGE INTO pushdown filter is not applied to a table defined with partition transform
URL: https://github.com/apache/iceberg/issues/10108
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2869268697
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "bk-mz (via GitHub)" <gi...@apache.org>.
bk-mz commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2440939666
cc @aokolnychyi @RussellSpitzer Folks can we discuss this issue? It's still clear that joining by actual value of the table partition way worse than specifying the partition manually.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "bk-mz (via GitHub)" <gi...@apache.org>.
bk-mz commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2082663671
@ludlows no, we didn't, we have to trim timestamp column to have filters working.
spark 3.5.0
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "bk-mz (via GitHub)" <gi...@apache.org>.
bk-mz commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2083476848
@aokolnychyi would this work on merge-on-read tables?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2439776791
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.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [I] MERGE INTO pushdown filter is not applied to a table defined with partition transform [iceberg]
Posted by "bk-mz (via GitHub)" <gi...@apache.org>.
bk-mz commented on issue #10108:
URL: https://github.com/apache/iceberg/issues/10108#issuecomment-2869536583
see here: https://github.com/apache/iceberg/issues/3607
Pushdown filters are not applicable for tables in Iceberg, instead runtime filters are used after BatchScan
```
+- BroadcastHashJoin [id#2818], [id#2003], Inner, BuildRight, false
:- Filter isnotnull(id#2818)
: +- Project [id#2818, _file#2821, _pos#2822L, _spec_id#2819, _partition#2820, monotonically_increasing_id() AS __row_id#2825L]
: +- Filter cast(timestamp#2816 as string) INSET 2025-05-08 04:00:00.0, 2025-05-08 05:00:00.0, 2025-05-08 06:00:00.0, 2025-05-08 07:00:00.0, 2025-05-08 08:00:00.0, 2025-05-08 09:00:00.0, 2025-05-08 10:00:00.0, 2025-05-08 11:00:00.0, 2025-05-08 12:00:00.0, 2025-05-08 13:00:00.0, 2025-05-08 14:00:00.0, 2025-05-08 15:00:00.0, 2025-05-08 16:00:00.0, 2025-05-08 17:00:00.0, 2025-05-08 18:00:00.0
: +- BatchScan local.db.table[timestamp#2816, id#2818, _file#2821, _pos#2822L, _spec_id#2819, _partition#2820] local.db.table (branch=null) [filters=, groupedBy=] RuntimeFilters: []
```
So it's working like that by design.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org