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/04/09 10:22:05 UTC

[GitHub] [spark] ulysses-you opened a new pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

ulysses-you opened a new pull request #32106:
URL: https://github.com/apache/spark/pull/32106


   
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### 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.
   -->
   Add check if the byte length over `int`.
   
   ### 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.
   -->
   We encounter a very extreme case with expression `concat_ws`, and the error msg is
   ```
   Caused by: java.lang.NegativeArraySizeException
   	at org.apache.spark.unsafe.types.UTF8String.concatWs
   ```
   Seems the `UTF8String.concat` has already done the length check at [#21064](https://github.com/apache/spark/pull/21064), so it's better to add in `concatWs`.
   
   
   ### 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'.
   -->
   Yes
   
   ### 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.
   -->
   It's too heavy to add the test.


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611387784



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(numInputBytes + (numInputs - 1) * separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       If we want to prevent overflow, we should do that for all operators:
   ```suggestion
       int resultSize = Math.addExact(
         numInputBytes,
         Math.multiplyExact(numInputs - 1, separator.numBytes));
       final byte[] result = new byte[resultSize];
   ```




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816668902


   **[Test build #137129 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137129/testReport)** for PR 32106 at commit [`fceb65b`](https://github.com/apache/spark/commit/fceb65bb6ebf9a80f25104f3d9cb5ba29b4199a9).
    * 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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817453305


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137187/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817614932


   **[Test build #137206 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137206/testReport)** for PR 32106 at commit [`73f4824`](https://github.com/apache/spark/commit/73f4824fcbb25a1a862fe41303d9e0268812562c).


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816612934


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41707/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817723122


   **[Test build #137206 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137206/testReport)** for PR 32106 at commit [`73f4824`](https://github.com/apache/spark/commit/73f4824fcbb25a1a862fe41303d9e0268812562c).
    * 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] maropu commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
maropu commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817735535


   late lgtm


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816584670


   **[Test build #137129 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137129/testReport)** for PR 32106 at commit [`fceb65b`](https://github.com/apache/spark/commit/fceb65bb6ebf9a80f25104f3d9cb5ba29b4199a9).


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817648782






-- 
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] ulysses-you commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r610672884



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Ints.checkedCast(numInputBytes + (numInputs - 1) * separator.numBytes);

Review comment:
       this code just follow the `concat` that do the same check.
   https://github.com/apache/spark/blob/c06758834e6192b1888b4a885c612a151588b390/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L974




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817436309


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41766/
   


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611432454



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,9 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(
+            numInputBytes + (numInputs - 1) * (long)separator.numBytes);

Review comment:
       Could you re-check the indentation. I guess it should be smaller.




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817732712






-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816612934


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41707/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r610625331



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Ints.checkedCast(numInputBytes + (numInputs - 1) * separator.numBytes);

Review comment:
       Why did you use guava here instead of just checking `numInputBytes` > `Int.MaxValue`?




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817420297


   **[Test build #137187 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137187/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611387784



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(numInputBytes + (numInputs - 1) * separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       If we want to prevent overflow, we should do that for all operators:
   ```suggestion
       int resultSize = Math.toIntExact(Math.addExact(
         numInputBytes,
         Math.multiplyExact(numInputs - 1, separator.numBytes)));
       final byte[] result = new byte[resultSize];
   ```




-- 
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] MaxGekk edited a comment on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk edited a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817738158


   @ulysses-you Would you like to review other places in UTF8String and make similar changes. For instance:
   https://github.com/apache/spark/blob/1be10124977bc32b580e37cf533328195ab6378c/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L910


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816675209


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137129/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817490403






-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817471527


   **[Test build #137196 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137196/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817642231


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41782/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817648784






-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817453305


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137187/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817448657


   **[Test build #137187 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137187/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).
    * 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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817543766


   **[Test build #137196 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137196/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).
    * 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 removed a comment on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817436309


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41766/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816584670


   **[Test build #137129 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137129/testReport)** for PR 32106 at commit [`fceb65b`](https://github.com/apache/spark/commit/fceb65bb6ebf9a80f25104f3d9cb5ba29b4199a9).


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816612893






-- 
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] MaxGekk commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817734047


   +1, LGTM. Merging to master.
   Thank you @ulysses-you and @maropu for your review.


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817605043


   **[Test build #137203 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137203/testReport)** for PR 32106 at commit [`9081799`](https://github.com/apache/spark/commit/9081799917b6a9136e8e7fb12e880e836fa2585c).


-- 
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] MaxGekk commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817738158


   @ulysses-you Would you like to review other places in UTF8String and made similar changes. For instance:
   https://github.com/apache/spark/blob/1be10124977bc32b580e37cf533328195ab6378c/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L910


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817432359






-- 
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] ulysses-you commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611428279



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(numInputBytes + (numInputs - 1) * separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       updated




-- 
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] ulysses-you commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611435812



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,9 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(
+            numInputBytes + (numInputs - 1) * (long)separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       done




-- 
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] ulysses-you commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-818425472


   created [#32142](https://github.com/apache/spark/pull/32142)


-- 
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] ulysses-you commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611409677



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(numInputBytes + (numInputs - 1) * separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       `numInputBytes` has  changed to long. you mean `(numInputs - 1) * separator.numBytes` can overflow ? yeah, maybe it can be. How about this ?
   ```
       int intNumInputBytes = Math.toIntExact(
               numInputBytes + (numInputs - 1) * (long)separator.numBytes);
   ```




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817492573


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41775/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817732716






-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817718498


   **[Test build #137203 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137203/testReport)** for PR 32106 at commit [`9081799`](https://github.com/apache/spark/commit/9081799917b6a9136e8e7fb12e880e836fa2585c).
    * 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] ulysses-you commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-818412094


   @MaxGekk created ticket [SPARK-35041](https://issues.apache.org/jira/browse/SPARK-35041)


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817648403






-- 
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] MaxGekk closed pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #32106:
URL: https://github.com/apache/spark/pull/32106


   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817420297


   **[Test build #137187 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137187/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817471527


   **[Test build #137196 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/137196/testReport)** for PR 32106 at commit [`7411b6e`](https://github.com/apache/spark/commit/7411b6ebb5d2cc5febed97c508acb3477ec24416).


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611425295



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(numInputBytes + (numInputs - 1) * separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       > you mean (numInputs - 1) * separator.numBytes can overflow ?
   
   yep
   
   > How about this ?
   
   I am ok with that.




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817492573


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/41775/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817560273


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137196/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817605043






-- 
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] ulysses-you commented on pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817471192


   retest this please


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611432849



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,9 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Math.toIntExact(
+            numInputBytes + (numInputs - 1) * (long)separator.numBytes);
+    final byte[] result = new byte[intNumInputBytes];

Review comment:
       BTW, you can put this in one line:
   ```suggestion
       int resultSize = Math.toIntExact(numInputBytes + (numInputs - 1) * (long)separator.numBytes);
       final byte[] result = new byte[resultSize];
   ```




-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-817560273


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137196/
   


-- 
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 #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32106:
URL: https://github.com/apache/spark/pull/32106#issuecomment-816675209


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/137129/
   


-- 
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] MaxGekk commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r610932865



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Ints.checkedCast(numInputBytes + (numInputs - 1) * separator.numBytes);

Review comment:
       Could you use `Math.toIntExact`, and replace `Ints.checkedCast` by `toIntExact`, please. I don't see any benefits of the Guava function over the standard function, do you?




-- 
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] ulysses-you commented on a change in pull request #32106: [SPARK-35005][SQL] Improve error msg if UTF8String concatWs length overflow

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #32106:
URL: https://github.com/apache/spark/pull/32106#discussion_r611278320



##########
File path: common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java
##########
@@ -1009,7 +1009,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) {
 
     // Allocate a new byte array, and copy the inputs one by one into it.
     // The size of the new array is the size of all inputs, plus the separators.
-    final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes];
+    int intNumInputBytes = Ints.checkedCast(numInputBytes + (numInputs - 1) * separator.numBytes);

Review comment:
       Replaced it.




-- 
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