-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-3654][SQL] Implement all extended HiveQL statements/commands with a separate parser combinator #2590
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
Conversation
cache,uncache,add jar etc.. and then parses with HiveQl
|
Can one of the admins verify this patch? |
|
ok to test |
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.
Since this class takes over all HiveQL parsing work (although it delegates to an underlying Hive parser), it's not accurate to call it a "pre parser", maybe this:
A parser that recognizes all HiveQL constructs together with several Spark SQL specific extensions like
CACHE TABLEandUNCACHE TABLE.
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.
Looks good. I updated as per your comment
|
QA tests have started for PR 2590 at commit
|
|
Awesome! I just started working on this last weekend and you've already got done :) Left some minor comments. This generally LGTM. |
|
QA tests have finished for PR 2590 at commit
|
Author-by: ravipesala <[email protected]>
|
Thank you. I updated the code as per your comments, Please review it. |
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.
Please follow this instruction to organize imports, and remove unused ones.
|
Left some more minor styling issues. This looks great :) |
|
Thank you for your comments. I updated code as per your comments.Please review. |
|
LGTM. |
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.
Remove extra newline.
|
Fixed code as per comments, please review |
|
Jenkins, retest this please. |
|
QA tests have started for PR 2590 at commit
|
|
QA tests have finished for PR 2590 at commit
|
|
Thanks! I've merged this to master. |
This PR is a follow up of #2590, and tries to introduce a top level SQL parser entry point for all SQL dialects supported by Spark SQL. A top level parser `SparkSQLParser` is introduced to handle the syntaxes that all SQL dialects should recognize (e.g. `CACHE TABLE`, `UNCACHE TABLE` and `SET`, etc.). For all the syntaxes this parser doesn't recognize directly, it fallbacks to a specified function that tries to parse arbitrary input to a `LogicalPlan`. This function is typically another parser combinator like `SqlParser`. DDL syntaxes introduced in #2475 can be moved to here. The `ExtendedHiveQlParser` now only handle Hive specific extensions. Also took the chance to refactor/reformat `SqlParser` for better readability. Author: Cheng Lian <[email protected]> Closes #2698 from liancheng/gen-sql-parser and squashes the following commits: ceada76 [Cheng Lian] Minor styling fixes 9738934 [Cheng Lian] Minor refactoring, removes optional trailing ";" in the parser bb2ab12 [Cheng Lian] SET property value can be empty string ce8860b [Cheng Lian] Passes test suites e86968e [Cheng Lian] Removes debugging code 8bcace5 [Cheng Lian] Replaces digit.+ to rep1(digit) (Scala style checking doesn't like it) d15d54f [Cheng Lian] Unifies SQL and HiveQL parsers
Created separate parser for hql. It preparses the commands like cache,uncache,add jar etc.. and then parses with HiveQl