Open
Conversation
kaikalur
suggested changes
Apr 1, 2021
|
|
||
| public class TestRewriteDriver | ||
| { | ||
| private static final String[] STATEMENT_THAT_DOESNT_NEED_REWRITE = new String[] { |
There was a problem hiding this comment.
See if we can just reuse the test we have for the rewrites without copying them.
| public class RewriteDriver | ||
| { | ||
| private static final Logger LOG = Logger.get(RewriteDriver.class); | ||
| private static final Set<Class<? extends Rewriter>> KNOWN_REWRITERS = ImmutableSet.of(OrderByRewriter.class); |
There was a problem hiding this comment.
Hmm, I thought the whole idea of the config is so people can just drop in a rewriter and use it? So I'm not sure if we need this.
|
|
||
| public class RewriteDriverConfig | ||
| { | ||
| private Set<Class<? extends Rewriter>> userEnabledRewriters = emptySet(); |
There was a problem hiding this comment.
So we would like users to be able to add a rewriter and pass in the name to be able to use it. It's not just about enabling a rewriter.
Member
Author
There was a problem hiding this comment.
Renamed to enabled_rewriters.
Done.
|
|
||
| import static java.util.Objects.requireNonNull; | ||
|
|
||
| public class RewriteDriverResult |
There was a problem hiding this comment.
WE need to find better name for this class.
Member
Author
There was a problem hiding this comment.
Renamed to RewriteResult.
Done.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added a RewriteDriver and supporting classes (config, result, module).
This driver is the link between Presto-Parser and Presto-Coresql's rewriters, allowing us to apply 0 or more of Presto-Coresql's rewrites to a SQL statement passed to Presto-Parser.