-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-12982][SQL] Add table name validation in temp table registration #11051
[SPARK-12982][SQL] Add table name validation in temp table registration #11051
Conversation
Update from original
Add table name validation in temp table registration
Added test case for validating table name
@@ -1291,4 +1291,14 @@ class DataFrameSuite extends QueryTest with SharedSQLContext { | |||
Seq(1 -> "a").toDF("i", "j").filter($"i".cast(StringType) === "1"), | |||
Row(1, "a")) | |||
} | |||
|
|||
test("SPARK-12982: Add table name validation in temp table registration") { | |||
val rows = List(Row("foo"), Row("bar")) |
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.
We can be a bit more concise: val df = Seq("foo", "bar").map(Tuple1.apply).toDF("col")
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.
@hvanhovell OK I will do the change
Jenkins, OK to test |
ok to test |
@davies can you trigger a test? |
Test build #2516 has finished for PR 11051 at commit
|
Removed extra white space.
@SparkQA Could you please test again |
Test build #2517 has finished for PR 11051 at commit
|
Modified test case by including more valid and invalid table names
@SparkQA @hvanhovell @davies |
@@ -1291,4 +1291,19 @@ class DataFrameSuite extends QueryTest with SharedSQLContext { | |||
Seq(1 -> "a").toDF("i", "j").filter($"i".cast(StringType) === "1"), | |||
Row(1, "a")) | |||
} | |||
|
|||
test("SPARK-12982: Add table name validation in temp table registration") { | |||
val rows = List(Row("foo"), Row("bar")) |
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.
We can be a bit more concise (also see the comment in the previous PR): val df = Seq(("one", "two")).toDF("a", "b")
retest this please |
@hvanhovell |
@jayadevanmurali you can request a retest by making a |
Thanks @hvanhovell for this info |
Incorporated review comments, Make the code more concise
retest this please |
LGTM pending tests |
Test build #2523 has finished for PR 11051 at commit
|
|
||
test("SPARK-12982: Add table name validation in temp table registration") { | ||
val df = Seq("foo", "bar").map(Tuple1.apply).toDF("col") | ||
//invalid table name test as below |
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.
You need to add a space between //
and the actual comment in order to pass style checks.
Insert one white space at the beginning of the comment.
Jenkins, retest this please |
retest this please |
@SparkQA |
retest this please |
@hvanhovell @davies |
retest this please |
1 similar comment
retest this please |
@jayadevanmurali I have no idea why builds aren't triggered (they should be). I haven't got the proper Jenkins rights to trigger a build yet. |
ok to test |
Test build #2530 has finished for PR 11051 at commit
|
// another invalid table name test as below | ||
intercept[AnalysisException](df.registerTempTable("#$@sum")) | ||
// another invalid table name test as below | ||
intercept[AnalysisException](df.registerTempTable("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.
Hmmmm... this one should fail. Let me submit a PR for this.
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.
Is this a new bug ?
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.
It is a bug, but it was in code base already. The fix is trivial (I need to add a separate rule for parsing table identifiers - which checks for an EOF).
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.
Ok thanks for the info. Let me know if you need any help from me.
…xpression string The parser currently parses the following strings without a hitch: * Table Identifier: * `a.b.c` should fail, but results in the following table identifier `a.b` * `table!#` should fail, but results in the following table identifier `table` * Expression * `1+2 r+e` should fail, but results in the following expression `1 + 2` This PR fixes this by adding terminated rules for both expression parsing and table identifier parsing. cc cloud-fan (we discussed this in #10649) jayadevanmurali (this causes your PR #11051 to fail) Author: Herman van Hovell <hvanhovell@questtec.nl> Closes #11159 from hvanhovell/SPARK-13276.
@hvanhovell Thanks for the quick fix, I think we can retest this PR now. What you think ? |
retest this please |
@hvanhovell I think, you may comment "ok to test" for triggering the build |
ok to test |
@jayadevanmurali issueing |
@jayadevanmurali Jenkins will be restarted in 30 mins. Lets try again after that. |
retest this please |
Ok. I think something missing in our test request, lot test started now which all requested after our PR |
Jenkins, test this please |
ok to test |
@shaneknapp any idea why Jenkins is not picking this up? |
jenkins test this please |
im not totally sure... jenkins is picking up other PRB builds. i'll poke around the (horrific) jenkins logs and see if i can't find out. |
it's building now: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/51120/ |
@shaneknapp thanks for your help! Any idea what caused this? |
Test build #51120 has finished for PR 11051 at commit
|
the GHPRB plugin is finicky, obtuse and opaque in it's operations. i have On Thu, Feb 11, 2016 at 11:07 AM, Herman van Hovell <
|
@shaneknapp Thanks for checking... The GHPRB just works in mysterious ways... |
Merging to master. Thanks! |
Add the table name validation at the temp table creation