-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-16475][SQL] broadcast hint for SQL queries - disallow space as the delimiter #16941
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -505,7 +505,13 @@ class PlanParserSuite extends PlanTest { | |
| val m2 = intercept[ParseException] { | ||
| parsePlan("SELECT /*+ MAPJOIN(default.t) */ * from default.t") | ||
| }.getMessage | ||
| assert(m2.contains("no viable alternative at input")) | ||
| assert(m2.contains("mismatched input '.' expecting {')', ','}")) | ||
|
|
||
| // Disallow space as the delimiter. | ||
| val m3 = intercept[ParseException] { | ||
| parsePlan("SELECT /*+ INDEX(a b c) */ * from default.t") | ||
| }.getMessage | ||
| assert(m3.contains("mismatched input 'b' expecting {')', ','}")) | ||
|
|
||
| comparePlans( | ||
| parsePlan("SELECT /*+ HINT */ * FROM t"), | ||
|
|
@@ -524,7 +530,7 @@ class PlanParserSuite extends PlanTest { | |
| Hint("STREAMTABLE", Seq("a", "b", "c"), table("t").select(star()))) | ||
|
|
||
| comparePlans( | ||
| parsePlan("SELECT /*+ INDEX(t emp_job_ix) */ * FROM t"), | ||
| parsePlan("SELECT /*+ INDEX(t, emp_job_ix) */ * FROM t"), | ||
|
Contributor
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. we can remove this test now, as it's duplicated if we use
Member
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. Hi, @viirya and @cloud-fan @hvanhovell @rxin @gatorsmile . Just for explanation, it was originally designed to support other syntax like the followings. Except query block parts (which we don't support), this case means https://docs.oracle.com/cd/B12037_01/server.101/b10752/hintsref.htm#21629 At that time, there was a request to provide more general syntax to prevent future changes on Anyway, I have no objection on the current approach since I also read the comments between @rxin and @viirya on the previous @rxin 's commit.
Contributor
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. Yea we can generalize it later.
Member
Author
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. @dongjoon-hyun Thanks for explanation. Looks like the syntax you referred only supports space as the delimiter? |
||
| Hint("INDEX", Seq("t", "emp_job_ix"), table("t").select(star()))) | ||
|
|
||
| comparePlans( | ||
|
|
||
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.
NIT: You can use the
PlanParserSuite.interceptmethod. That saves some typing.