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/02/03 11:46:58 UTC

[GitHub] [spark] sarutak opened a new pull request #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

sarutak opened a new pull request #31457:
URL: https://github.com/apache/spark/pull/31457


   ### 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.
   -->
   This is an backport PR.
   This PR fixes an issue that `Dataset.colRegex` doesn't work with column names or qualifiers which contain newlines.
   In the current master, if column names or qualifiers passed to `colRegex` contain newlines, it throws exception.
   ```
   val df = Seq(1, 2, 3).toDF("test\n_column").as("test\n_table")
   val col1 = df.colRegex("`tes.*\n.*mn`")
   org.apache.spark.sql.AnalysisException: Cannot resolve column name "`tes.*
   .*mn`" among (test
   _column)
     at org.apache.spark.sql.Dataset.org$apache$spark$sql$Dataset$$resolveException(Dataset.scala:272)
     at org.apache.spark.sql.Dataset.$anonfun$resolve$1(Dataset.scala:263)
     at scala.Option.getOrElse(Option.scala:189)
     at org.apache.spark.sql.Dataset.resolve(Dataset.scala:263)
     at org.apache.spark.sql.Dataset.colRegex(Dataset.scala:1407)
     ... 47 elided
   
   val col2 = df.colRegex("test\n_table.`tes.*\n.*mn`")
   org.apache.spark.sql.AnalysisException: Cannot resolve column name "test
   _table.`tes.*
   .*mn`" among (test
   _column)
     at org.apache.spark.sql.Dataset.org$apache$spark$sql$Dataset$$resolveException(Dataset.scala:272)
     at org.apache.spark.sql.Dataset.$anonfun$resolve$1(Dataset.scala:263)
     at scala.Option.getOrElse(Option.scala:189)
     at org.apache.spark.sql.Dataset.resolve(Dataset.scala:263)
     at org.apache.spark.sql.Dataset.colRegex(Dataset.scala:1407)
     ... 47 elided
   ```
   
   ### 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.
   -->
   Column names and qualifiers can contain newlines but `colRegex` can't work with them, so it's a bug.
   
   ### 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. users can pass column names and qualifiers even though they contain newlines.
   
   ### 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.
   -->
   New 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] AmplabJenkins removed a comment on pull request #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


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


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39421/
   


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39421/
   


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   **[Test build #134834 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134834/testReport)** for PR 31457 at commit [`7d0476d`](https://github.com/apache/spark/commit/7d0476d79287a550aa82a7d6e8ecc3daa3a8f7e3).


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   @srowen Thanks. I've 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] srowen commented on pull request #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   (Backport of https://github.com/apache/spark/pull/31426 for the record - might be good to put in the description)
   Seems fine if it passes and is a backport.


----------------------------------------------------------------
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] HyukjinKwon commented on pull request #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   Merged to branch-3.1.


----------------------------------------------------------------
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] HyukjinKwon closed pull request #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   **[Test build #134834 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134834/testReport)** for PR 31457 at commit [`7d0476d`](https://github.com/apache/spark/commit/7d0476d79287a550aa82a7d6e8ecc3daa3a8f7e3).
    * 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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


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


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


   **[Test build #134834 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/134834/testReport)** for PR 31457 at commit [`7d0476d`](https://github.com/apache/spark/commit/7d0476d79287a550aa82a7d6e8ecc3daa3a8f7e3).


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


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


----------------------------------------------------------------
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 #31457: [SPARK-34318][SQL][3.1] Dataset.colRegex should work with column names and qualifiers which contain newlines

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


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


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