-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Enable rewriting certain inner joins as filters. #11068
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
156878e
Enable rewriting certain inner joins as filters.
gianm 64508f3
Test improvements.
gianm c7710b1
Test fixes.
gianm 620129a
Avoid slow size() call.
gianm 62f88b7
Remove invalid test.
gianm 32ea480
Fix style.
gianm c4feee8
Fix mistaken default.
gianm c262a24
Small fixes.
gianm e7c06bf
Fix logic error.
gianm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -54,6 +54,7 @@ public class QueryContexts | |||||
public static final String JOIN_FILTER_PUSH_DOWN_KEY = "enableJoinFilterPushDown"; | ||||||
public static final String JOIN_FILTER_REWRITE_ENABLE_KEY = "enableJoinFilterRewrite"; | ||||||
public static final String JOIN_FILTER_REWRITE_VALUE_COLUMN_FILTERS_ENABLE_KEY = "enableJoinFilterRewriteValueColumnFilters"; | ||||||
public static final String REWRITE_JOIN_TO_FILTER_ENABLE_KEY = "enableRewriteJoinToFilter"; | ||||||
public static final String JOIN_FILTER_REWRITE_MAX_SIZE_KEY = "joinFilterRewriteMaxSize"; | ||||||
// This flag control whether a sql join query with left scan should be attempted to be run as direct table access | ||||||
// instead of being wrapped inside a query. With direct table access enabled, druid can push down the join operation to | ||||||
|
@@ -80,6 +81,7 @@ public class QueryContexts | |||||
public static final boolean DEFAULT_ENABLE_JOIN_FILTER_PUSH_DOWN = true; | ||||||
public static final boolean DEFAULT_ENABLE_JOIN_FILTER_REWRITE = true; | ||||||
public static final boolean DEFAULT_ENABLE_JOIN_FILTER_REWRITE_VALUE_COLUMN_FILTERS = false; | ||||||
public static final boolean DEFAULT_ENABLE_REWRITE_JOIN_TO_FILTER = false; | ||||||
public static final long DEFAULT_ENABLE_JOIN_FILTER_REWRITE_MAX_SIZE = 10000; | ||||||
public static final boolean DEFAULT_ENABLE_SQL_JOIN_LEFT_SCAN_DIRECT = false; | ||||||
public static final boolean DEFAULT_USE_FILTER_CNF = false; | ||||||
|
@@ -274,6 +276,7 @@ public static <T> int getParallelMergeParallelism(Query<T> query, int defaultVal | |||||
{ | ||||||
return parseInt(query, BROKER_PARALLELISM, defaultValue); | ||||||
} | ||||||
|
||||||
public static <T> boolean getEnableJoinFilterRewriteValueColumnFilters(Query<T> query) | ||||||
{ | ||||||
return parseBoolean( | ||||||
|
@@ -283,6 +286,15 @@ public static <T> boolean getEnableJoinFilterRewriteValueColumnFilters(Query<T> | |||||
); | ||||||
} | ||||||
|
||||||
public static <T> boolean getEnableRewriteJoinToFilter(Query<T> query) | ||||||
{ | ||||||
return parseBoolean( | ||||||
query, | ||||||
REWRITE_JOIN_TO_FILTER_ENABLE_KEY, | ||||||
DEFAULT_ENABLE_JOIN_FILTER_REWRITE_VALUE_COLUMN_FILTERS | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😱 |
||||||
); | ||||||
} | ||||||
|
||||||
public static <T> long getJoinFilterRewriteMaxSize(Query<T> query) | ||||||
{ | ||||||
return parseLong(query, JOIN_FILTER_REWRITE_MAX_SIZE_KEY, DEFAULT_ENABLE_JOIN_FILTER_REWRITE_MAX_SIZE); | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍