Uh oh!
There was an error while loading. Please reload this page.
[SPARK-30049][SQL] SQL fails to parse when comment contains an unmatched quote character. - #27321
[SPARK-30049][SQL] SQL fails to parse when comment contains an unmatched quote character.#27321javierivanov wants to merge 4 commits into
Conversation
dongjoon-hyun
commented
Jan 22, 2020
ok to test |
SparkQA
commented
Jan 22, 2020
Test build #117249 has finished for PR 27321 at commit
|
HyukjinKwon
commented
Jan 23, 2020
cc @wangyum FYI |
tgravescs
commented
Jan 23, 2020
I haven't had time to test your patch but did you test this with just the spark-shell and spark.sql(""" """) syntax as well? I didn't think that went through the SparkSQLCliDriver and that case also fails. |
kiszk
commented
Feb 3, 2020
ping @javierivanov |
javierivanov
commented
Feb 3, 2020
Sorry for my delay here... In this case the The SQLDriver is parsing SQLStatements into a list, and foreach calls the sql context to interpret each. This was failing because the parser was still detecting quotes inside of comments and passed the sql statement like this: Let me know for any comments 👍 |
maropu
commented
Feb 5, 2020
yea, right. Spark doesnt support multi-line queries in |
Uh oh!
There was an error while loading. Please reload this page.
| |;""".stripMargin -> "testcomment" | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
nit: Can you avoid this unnecessary blank?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tgravescs
commented
Feb 6, 2020
ah ok, that makes sense, thanks |
SparkQA
commented
Feb 6, 2020
Test build #117997 has finished for PR 27321 at commit
|
maropu
commented
Feb 7, 2020
ping @wangyum |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Feb 26, 2020
Test build #118967 has finished for PR 27321 at commit
|
tgravescs
commented
Feb 28, 2020
@wangyum any comments? |
…hed quote character ### What changes were proposed in this pull request? A SQL statement that contains a comment with an unmatched quote character can lead to a parse error: - Added a insideComment flag in the splitter method to avoid checking single and double quotes within a comment: ``` spark-sql> SELECT 1 -- someone's comment here > ; Error in query: extraneous input ';' expecting <EOF>(line 2, pos 0) == SQL == SELECT 1 -- someone's comment here ; ^^^ ``` ### Why are the changes needed? This misbehaviour was not present on previous spark versions. ### Does this PR introduce any user-facing change? - No ### How was this patch tested? - New tests were added. Closes#27321 from javierivanov/SPARK-30049B. Lead-authored-by: Javier <jfuentes@hortonworks.com> Co-authored-by: Javier Fuentes <j.fuentes.m@icloud.com> Signed-off-by: Thomas Graves <tgraves@apache.org> (cherry picked from commit 3ff2135) Signed-off-by: Thomas Graves <tgraves@apache.org>
tgravescs
commented
Mar 3, 2020
merged to master and branch-3.0, thanks @javierivanov |
gatorsmile
commented
Mar 4, 2020
dongjoon-hyun
commented
Mar 10, 2020
Hi, All. |
…hed quote character ### What changes were proposed in this pull request? A SQL statement that contains a comment with an unmatched quote character can lead to a parse error: - Added a insideComment flag in the splitter method to avoid checking single and double quotes within a comment: ``` spark-sql> SELECT 1 -- someone's comment here > ; Error in query: extraneous input ';' expecting <EOF>(line 2, pos 0) == SQL == SELECT 1 -- someone's comment here ; ^^^ ``` ### Why are the changes needed? This misbehaviour was not present on previous spark versions. ### Does this PR introduce any user-facing change? - No ### How was this patch tested? - New tests were added. Closesapache#27321 from javierivanov/SPARK-30049B. Lead-authored-by: Javier <jfuentes@hortonworks.com> Co-authored-by: Javier Fuentes <j.fuentes.m@icloud.com> Signed-off-by: Thomas Graves <tgraves@apache.org>
What changes were proposed in this pull request?
A SQL statement that contains a comment with an unmatched quote character can lead to a parse error:
Why are the changes needed?
This misbehaviour was not present on previous spark versions.
Does this PR introduce any user-facing change?
How was this patch tested?