[native] Disable Nested Loop Join in Prestissimo.#23341
[native] Disable Nested Loop Join in Prestissimo.#23341kgpai wants to merge 1 commit intoprestodb:masterfrom
Conversation
ac84520 to
0005412
Compare
|
@kgpai @amitkdutta : We have encountered this issue already (#22585). This drastic fix is not needed. You can correct the grouping behavior to avoid streaming aggregation using #22998 If there is urgency then #22998 is better for you. |
CC: @pedroerp @mbasmanova |
| auto streamable = !node->preGroupedVariables.empty() | ||
| && node->groupingSets.groupingSetCount == 1 | ||
| && node->groupingSets.globalGroupingSets.empty(); | ||
| VELOX_CHECK(!streamable, |
There was a problem hiding this comment.
Is it possible to just use a regular aggregation instead of failing?
There was a problem hiding this comment.
@rschlussel : Yes. You are correct.
There is a nuance though, HashAggregation also has preGrouping related optimizations which streamable should disable.
That is the fix in #22998.
@pedroerp @mbasmanova : For context we had tried fixing the NestedLoopJoin in Velox to maintain the grouping property on LHS as well, but there was lot of overhead to maintain RHS to give such behavior. ref facebookincubator/velox#10048 |
0005412 to
fe2f054
Compare
fe2f054 to
ff877fc
Compare
|
@aditi-pandit Based on inputs from @rschlussel its probably safer to turn off NLJ till its fixed. |
@kgpai @rschlussel : Agree this is a more conservative fix. Please feel free to go ahead with it if you prefer. |
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 27a3384...aa5761e. No notifications. |
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ff877fc to
28a6819
Compare
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
I am seeing a couple of failures related to docker compose: https://github.com/prestodb/presto/actions/runs/10204170880/job/28232117475?pr=23341 |
28a6819 to
d84549a
Compare
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
1173acf to
c6b6eb3
Compare
|
@rschlussel @amitkdutta @aditi-pandit Please have a look again, I have gated this under a configuration. |
c6b6eb3 to
092dca3
Compare
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@kgpai Would you please also disable streaming agg when nestedloopjoin is enabled? cc: @aditi-pandit |
092dca3 to
2d2f62a
Compare
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
2d2f62a to
67c4a39
Compare
|
@kgpai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@karteekmurthys : Let Krishna proceed with this change to keep it minimal. You can add the correction (disable pre-grouping (not disable streaming)) when !disableNestedLoopJoin in a subsequent PR since you are more familiar with those code-paths. |
c028258 to
61cdbb8
Compare
|
Unfortunately there are a lot more tests than I anticipated that depend on NLJ. |
61cdbb8 to
076b32d
Compare
|
This PR should address the NLJ issue in Velox, so hopefully this won't be needed: facebookincubator/velox#10651 |
076b32d to
aa5761e
Compare
Description
This PR disables NestedLoopJoins when converting plans to Velox. This is gated by the property : fail_on_nested_loop_join .
Motivation and Context
Currently there is a bug with Streaming aggregations when the source is a Nested loop join. (#22585)
Impact
Test Plan
Adding test cases.