-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPJ] Skweded partitions harm merge performances #11800
Comments
@szehon-ho I saw that video you made on this topic during the Iceberg Summit. Do you see anything missing in the configuration ? |
Yes unfortunately that optimization is a bit limited, it splits the big size and replicate the small side, so is only correct to do for inner join. I think in this case, you have matched and not matched, so it is an outer join, and not eligible |
Thank you for your fast reply @szehon-ho. What do you suggest for this kind of situations ? |
Yea im not sure how to solve the problem. What do you mean salting? To explain the current problem, if you have two side [A] and [B], the algoirthm split A and duplicate B like [A1, B], [A2, B], [A3, B]. If you have A outer join B, then it wont work because rows of B will appear multiple times. |
Yeah I see the problem now. Thanks. |
Hm not sure i get it, can you give an example? SPJ is at the planning stage, we have to decide what partition from each side to put together. |
I don't know if it makes sense regarding Spark/Iceberg internals. If we consider the following example
After the partition split we'll get the following :
In case we have a The idea I was suggesting consists in :
|
Hm, but for "not match" check, you need to check each replicated partition against all the splitted partitions, so it defeats the point of splitting I think. |
Hm I'm a little bit confused. The check need be done only once since the replicated partitions hold the same data, right ? |
I think there are two 'not matched' here, Case (1) is do-able. TableA(split) TableB (replicate) (1, a) (1, a) (2, b) (1, a) The second pair (2, b) vs (1, a) will wrongly calculate that TableB has a non-match with TableA and return (1,a). But actually it match in the first pair. Hope that makes sense. |
Query engine
Question
Hi
I have two s3 data sources, full_time_series and batch_time_series. Both tables are clustered by measure and datetime columns. Theses tables are partitionned by month(datetime).
I'm using the following configurations to enable SPJ and tune performance by using a shuffle hash join istead of a sort merge join :
Unless I'm mistaken, the configuration
spark.sql.sources.v2.bucketing.partiallyClusteredDistribution.enabled = true
is used to split big partitions into smaller chunks. Even tough this configuration is enabled I'm getting skewed partitions as shown in the figure below :Here is the query I'm performing :
merge into full_time_series target using full_time_series as source on target.measure = source.measure and target.datetime_utc = source.datetime_utc when matched then update set * when not matched then insert *
The text was updated successfully, but these errors were encountered: