You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/27 12:03:48 UTC
[GitHub] [spark] sarutak opened a new pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
sarutak opened a new pull request #31362:
URL: https://github.com/apache/spark/pull/31362
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
In the current master, the code for treating unicode/octal/escaped characters in string literals is a little bit complex so let's simplify it.
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
To keep it easy to maintain.
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No.
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
`ParserUtilsSuite` passes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770540105
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39284/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770530074
**[Test build #134698 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134698/testReport)** for PR 31362 at commit [`eed6e99`](https://github.com/apache/spark/commit/eed6e99512da669ee67ef22c6a3375536a36cd90).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770798938
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134716/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770560938
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39284/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768367359
**[Test build #134557 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134557/testReport)** for PR 31362 at commit [`82b8fb9`](https://github.com/apache/spark/commit/82b8fb9e0f9ce31214984df5beec45390fd8e6aa).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770622320
**[Test build #134716 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134716/testReport)** for PR 31362 at commit [`cd8e765`](https://github.com/apache/spark/commit/cd8e765a5dc163e93631f811a17a09e35c5f7983).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770655763
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39302/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768448521
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39143/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770639860
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39302/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] srowen commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
srowen commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770387018
You're welcome to merge when ready.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] asfgit closed pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #31362:
URL: https://github.com/apache/spark/pull/31362
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770530074
**[Test build #134698 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134698/testReport)** for PR 31362 at commit [`eed6e99`](https://github.com/apache/spark/commit/eed6e99512da669ee67ef22c6a3375536a36cd90).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768557733
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134557/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768260104
**[Test build #134549 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134549/testReport)** for PR 31362 at commit [`c2ae791`](https://github.com/apache/spark/commit/c2ae7917e799c7503a02164f20c855acd3626d9c).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768260104
**[Test build #134549 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134549/testReport)** for PR 31362 at commit [`c2ae791`](https://github.com/apache/spark/commit/c2ae7917e799c7503a02164f20c855acd3626d9c).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770560938
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39284/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sarutak commented on a change in pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
sarutak commented on a change in pull request #31362:
URL: https://github.com/apache/spark/pull/31362#discussion_r567537280
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala
##########
@@ -187,33 +178,19 @@ object ParserUtils {
sb.append(highSurrogate.toChar)
sb.append(lowSurrogate.toChar)
}
- i += 9
- } else if (i + 4 < strLength) {
+ charBuffer.position(charBuffer.position() + 10)
+ case OCTAL_CHAR_PATTERN(cp) =>
// \000 style character literals.
-
- val i1 = b.charAt(i + 1)
- val i2 = b.charAt(i + 2)
- val i3 = b.charAt(i + 3)
-
- if ((i1 >= '0' && i1 <= '1') && (i2 >= '0' && i2 <= '7') && (i3 >= '0' && i3 <= '7')) {
- val tmp = ((i3 - '0') + ((i2 - '0') << 3) + ((i1 - '0') << 6)).asInstanceOf[Char]
- sb.append(tmp)
- i += 3
- } else {
- appendEscapedChar(i1)
- i += 1
- }
- } else if (i + 2 < strLength) {
+ sb.append(Integer.parseInt(cp, 8).toChar)
+ charBuffer.position(charBuffer.position() + 4)
+ case ESCAPED_CHAR_PATTERN(c) =>
// escaped character literals.
- val n = b.charAt(i + 1)
- appendEscapedChar(n)
- i += 1
- }
- } else {
- // non-escaped character literals.
- sb.append(currentChar)
+ appendEscapedChar(c.charAt(0))
+ charBuffer.position(charBuffer.position() + 2)
+ case _ =>
+ // non-escaped character literals.
+ sb.append(charBuffer.get())
Review comment:
I think it's almost the same. Just checked with `SELECT "(10000 characters)";` and I recognized no remarkable difference.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770655763
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770796375
**[Test build #134716 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134716/testReport)** for PR 31362 at commit [`cd8e765`](https://github.com/apache/spark/commit/cd8e765a5dc163e93631f811a17a09e35c5f7983).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768365325
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770647272
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134698/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770629570
**[Test build #134698 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134698/testReport)** for PR 31362 at commit [`eed6e99`](https://github.com/apache/spark/commit/eed6e99512da669ee67ef22c6a3375536a36cd90).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768540786
**[Test build #134557 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134557/testReport)** for PR 31362 at commit [`82b8fb9`](https://github.com/apache/spark/commit/82b8fb9e0f9ce31214984df5beec45390fd8e6aa).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768367359
**[Test build #134557 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134557/testReport)** for PR 31362 at commit [`82b8fb9`](https://github.com/apache/spark/commit/82b8fb9e0f9ce31214984df5beec45390fd8e6aa).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770622320
**[Test build #134716 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134716/testReport)** for PR 31362 at commit [`cd8e765`](https://github.com/apache/spark/commit/cd8e765a5dc163e93631f811a17a09e35c5f7983).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768557733
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134557/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sarutak commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
sarutak commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-771746379
Merged to `master`. Thanks all!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770655763
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770655740
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39302/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768343073
Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39135/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768285121
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39135/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768365325
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] maropu commented on a change in pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31362:
URL: https://github.com/apache/spark/pull/31362#discussion_r567524336
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala
##########
@@ -187,33 +178,19 @@ object ParserUtils {
sb.append(highSurrogate.toChar)
sb.append(lowSurrogate.toChar)
}
- i += 9
- } else if (i + 4 < strLength) {
+ charBuffer.position(charBuffer.position() + 10)
+ case OCTAL_CHAR_PATTERN(cp) =>
// \000 style character literals.
-
- val i1 = b.charAt(i + 1)
- val i2 = b.charAt(i + 2)
- val i3 = b.charAt(i + 3)
-
- if ((i1 >= '0' && i1 <= '1') && (i2 >= '0' && i2 <= '7') && (i3 >= '0' && i3 <= '7')) {
- val tmp = ((i3 - '0') + ((i2 - '0') << 3) + ((i1 - '0') << 6)).asInstanceOf[Char]
- sb.append(tmp)
- i += 3
- } else {
- appendEscapedChar(i1)
- i += 1
- }
- } else if (i + 2 < strLength) {
+ sb.append(Integer.parseInt(cp, 8).toChar)
+ charBuffer.position(charBuffer.position() + 4)
+ case ESCAPED_CHAR_PATTERN(c) =>
// escaped character literals.
- val n = b.charAt(i + 1)
- appendEscapedChar(n)
- i += 1
- }
- } else {
- // non-escaped character literals.
- sb.append(currentChar)
+ appendEscapedChar(c.charAt(0))
+ charBuffer.position(charBuffer.position() + 2)
+ case _ =>
+ // non-escaped character literals.
+ sb.append(charBuffer.get())
Review comment:
Just out of curiosity; the performance of the `non-escpaed` long string case is almost the same before/after this PR? This improvement itself looks fine though.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768448521
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/39143/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] asfgit closed pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #31362:
URL: https://github.com/apache/spark/pull/31362
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins removed a comment on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770647272
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/134698/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sarutak commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
sarutak commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-771746379
Merged to `master`. Thanks all!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-768335952
**[Test build #134549 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134549/testReport)** for PR 31362 at commit [`c2ae791`](https://github.com/apache/spark/commit/c2ae7917e799c7503a02164f20c855acd3626d9c).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770547865
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39284/
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] sarutak commented on pull request #31362: [SPARK-34263][SQL] Simplify the code for treating unicode/octal/escaped characters in string literals
Posted by GitBox <gi...@apache.org>.
sarutak commented on pull request #31362:
URL: https://github.com/apache/spark/pull/31362#issuecomment-770526583
@srowen I noticed an incompatible behavior and fixed it (also added an assertion for that case).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org