[GLUTEN-10559] Simplify StrictRule and remove unnecessary DummyLeafExec#10553
[GLUTEN-10559] Simplify StrictRule and remove unnecessary DummyLeafExec#10553beliefer wants to merge 1 commit into
Conversation
|
Run Gluten Clickhouse CI on x86 |
|
Run Gluten Clickhouse CI on x86 |
|
ping @zhztheplayer @zml1206 |
zhztheplayer
left a comment
There was a problem hiding this comment.
Hiding the children helps simplifying the offloading process of one single node. For consecutive matching of different nodes, we normally add an individual "transform rule" for that. You can view VeloxRuleApi for more usage patterns.
May I know what led you to this attempt?
Thank you! I know that. In fact, |
I may lose the contexts... Would you elaborate on this? Thanks. |
Take an example, a When hiding the children of |
I still don't understand the example. Are you able to share the plans before and after the strict rule? |
I added an example into PR's description. |
|
OffloadOthers(), OffloadExchange(), and OffloadJoin() do not traverse the plan internally, so I also think DummyLeafExec is not necessary. |
Can we keep the hiding children logic in testing only? We should make sure the single node rules doesn't touch the children nodes to keep the logic atomic. If a rule matches and offloads a sub-tree, it should be placed in post-transform instead. |
I have no idea how to implement this test. I see that the trait OffloadSingleNode has added a note, is it sufficient? |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
Please hold this one. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
This PR was auto-closed because it has been stalled for 10 days with no activity. Please feel free to reopen if it is still valid. Thanks. |
What changes are proposed in this pull request?
This PR proposes to simplify
StrictRuleand remove unnecessaryDummyLeafExec.Fixes: #10559
This improvement can advance the perf of Spark driver. I paste the perf below.
Before this improvement, the benchmark of TPCDS SF1000 show below.
Before this improvement, the benchmark of TPCDS SF1000 show below.
The average perf advances 3.52% and the median perf advances 2.83%.
There is an example.
The original plan:
Before this PR, the transform process is as follows:
Because the mechanism of
transfomUp, treatScan OneRowRelation[]first.Scan OneRowRelation[]do not have any children, so nothing could be hidden.Scan OneRowRelation[]cannot be offloaded, so the plan will not change. The current plan show below.Because
Scan OneRowRelation[]do not have any children, so nothing need restore from hidden.So the plan will not change. The current plan show below.
Because the mechanism of
transfomUp, treatProject [3 AS e#8L, 1 AS c#10, 2 AS d#9L]now. The childScan OneRowRelation[]would be hide.So the plan changed. The current plan show below.
After offload
Project [3 AS e#8L, 1 AS c#10, 2 AS d#9L], the plan would be ...Now restore the child from hidden. The plan would be ...
After this PR, the transform process is as follows:
Because the mechanism of
transfomUp, treatScan OneRowRelation[]first.Scan OneRowRelation[]cannot be offloaded, so the plan will not change. The current plan show below.Because the mechanism of
transfomUp, treatProject [3 AS e#8L, 1 AS c#10, 2 AS d#9L]now.After offload
Project [3 AS e#8L, 1 AS c#10, 2 AS d#9L], the plan would be ...How was this patch tested?
GA tests.