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 2020/08/15 09:24:00 UTC

[GitHub] [spark] AngersZhuuuu opened a new pull request #29438: SPARK-32607: Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

AngersZhuuuu opened a new pull request #29438:
URL: https://github.com/apache/spark/pull/29438


   ### What changes were proposed in this pull request?
   Scrip Transform no-serde (`ROW FORMAT DELIMITED`) mode `LINE TERMINNATED BY `
   only support `\n`.
   
   Tested in hive :    
   Hive 1.1
   ![image](https://user-images.githubusercontent.com/46485123/90309510-ce82a180-df1b-11ea-96ab-56e2b3229489.png)
   
   Hive 2.3.7
   ![image](https://user-images.githubusercontent.com/46485123/90309504-c88cc080-df1b-11ea-853e-8f65e9ed2375.png)
   
   
   
   ### Why are the changes needed?
   Strictly limit the use method to ensure the accuracy of data
   
   
   ### Does this PR introduce _any_ user-facing change?
   User use Scrip Transform no-serde (ROW FORMAT DELIMITED) mode  with `LINE TERMINNATED BY `
   not equal `'\n'`. will throw error
   
   
   ### How was this patch tested?
   Added UT
   


----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -759,6 +759,12 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {
         def entry(key: String, value: Token): Seq[(String, String)] = {
           Option(value).map(t => key -> t.getText).toSeq
         }
+
+        if (Option(c.linesSeparatedBy).map(string).getOrElse("\n") != "\n") {

Review comment:
       > IMO its okay to support any char as a line separator normally.
   
   In this way ,  line Separator must be a char. since it's hard to write a high-performance Reader (like BufferedReader.getLine) that can get one row data with string line separator . 
   
   if just support char as line delim, we can just rewrite a reader like BufferedReader.
   
   > We need to follow this restriction of Hive?
    Script transform's user always come from hive. It ok just to follow hive and this behavior is straight forward and simple.




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127472 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127472/testReport)** for PR 29438 at commit [`32fa37c`](https://github.com/apache/spark/commit/32fa37ccab3cfd22eef252297ecf21453012bbd8).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] cloud-fan commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29438:
URL: https://github.com/apache/spark/pull/29438#issuecomment-677605445


   thanks, merging to master!


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -330,4 +330,42 @@ class SparkSqlParserSuite extends AnalysisTest {
     assertEqual("ADD FILE /path with space/abc.txt", AddFileCommand("/path with space/abc.txt"))
     assertEqual("ADD JAR /path with space/abc.jar", AddJarCommand("/path with space/abc.jar"))
   }
+
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       > If it only supports one value, why do we ever provide a clause to set it?
   
   Perhaps it's because previous developers have followed hive's approach. 




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127486 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127486/testReport)** for PR 29438 at commit [`93d6d85`](https://github.com/apache/spark/commit/93d6d857c884e07a350021524086cd5483b165e7).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


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


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127471 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127471/testReport)** for PR 29438 at commit [`04ed7d8`](https://github.com/apache/spark/commit/04ed7d884710ba61d02f31c4aac90a5d1e09a9e5).
    * 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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127639 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127639/testReport)** for PR 29438 at commit [`e15f1e8`](https://github.com/apache/spark/commit/e15f1e89baac881750d884d182fa317bece41057).
    * This patch **fails Scala style tests**.
    * This patch merges cleanly.
    * This patch adds the following public classes _(experimental)_:
     * `  public final class MapIteratorWithKeyIndex implements Iterator<Location> `
     * `class PartitionAlreadyExistsException(message: String) extends AnalysisException(message) `
     * `class PartitionsAlreadyExistException(message: String) extends AnalysisException(message) `
     * `class NoSuchPartitionException(message: String) extends AnalysisException(message) `
     * `class NoSuchPartitionsException(message: String) extends AnalysisException(message) `


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127471 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127471/testReport)** for PR 29438 at commit [`04ed7d8`](https://github.com/apache/spark/commit/04ed7d884710ba61d02f31c4aac90a5d1e09a9e5).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


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


----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29438:
URL: https://github.com/apache/spark/pull/29438#discussion_r473816558



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -362,13 +362,51 @@ class SparkSqlParserSuite extends AnalysisTest {
         Seq(("TOK_TABLEROWFORMATFIELD", ","),
           ("TOK_TABLEROWFORMATCOLLITEMS", "#"),
           ("TOK_TABLEROWFORMATMAPKEYS", "@"),
-          ("TOK_TABLEROWFORMATLINES", "\n"),
-          ("TOK_TABLEROWFORMATNULL", "null")),
+          ("TOK_TABLEROWFORMATNULL", "null"),
+          ("TOK_TABLEROWFORMATLINES", "\n")),

Review comment:
       is it necessary to switch the order here?




----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29438:
URL: https://github.com/apache/spark/pull/29438#discussion_r472878919



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -330,4 +330,42 @@ class SparkSqlParserSuite extends AnalysisTest {
     assertEqual("ADD FILE /path with space/abc.txt", AddFileCommand("/path with space/abc.txt"))
     assertEqual("ADD JAR /path with space/abc.jar", AddJarCommand("/path with space/abc.jar"))
   }
+
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       what's the drawback if we don't forbid arbitrary line terminator?




----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -362,13 +362,51 @@ class SparkSqlParserSuite extends AnalysisTest {
         Seq(("TOK_TABLEROWFORMATFIELD", ","),
           ("TOK_TABLEROWFORMATCOLLITEMS", "#"),
           ("TOK_TABLEROWFORMATMAPKEYS", "@"),
-          ("TOK_TABLEROWFORMATLINES", "\n"),
-          ("TOK_TABLEROWFORMATNULL", "null")),
+          ("TOK_TABLEROWFORMATNULL", "null"),
+          ("TOK_TABLEROWFORMATLINES", "\n")),

Review comment:
       > is it necessary to switch the order here?
   
   Yea, follow change from SparkSqlParser.




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127653 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127653/testReport)** for PR 29438 at commit [`ed60af5`](https://github.com/apache/spark/commit/ed60af531de3787d40f61b7eaf024811860ccb07).


----------------------------------------------------------------
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] AngersZhuuuu commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   > the fix looks good, can you resolve conflicts?
   
   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] AmplabJenkins commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -759,6 +759,12 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {
         def entry(key: String, value: Token): Seq[(String, String)] = {
           Option(value).map(t => key -> t.getText).toSeq
         }
+
+        if (Option(c.linesSeparatedBy).map(string).getOrElse("\n") != "\n") {

Review comment:
       cc @maropu  https://github.com/apache/spark/blob/1a4c8f718f748d8c2a39f0a3b209ce606bffe958/sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala#L671-L675




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127640 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127640/testReport)** for PR 29438 at commit [`15d6db7`](https://github.com/apache/spark/commit/15d6db7ad06ff673423399863de0baeca8559fb8).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127640 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127640/testReport)** for PR 29438 at commit [`15d6db7`](https://github.com/apache/spark/commit/15d6db7ad06ff673423399863de0baeca8559fb8).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -330,4 +330,42 @@ class SparkSqlParserSuite extends AnalysisTest {
     assertEqual("ADD FILE /path with space/abc.txt", AddFileCommand("/path with space/abc.txt"))
     assertEqual("ADD JAR /path with space/abc.jar", AddJarCommand("/path with space/abc.jar"))
   }
+
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       > what's the drawback if we don't forbid arbitrary line terminator?
   
   If user use wrong delimit , will got wrong result since in no-serde mode, we read output line by '\n'




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127639 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127639/testReport)** for PR 29438 at commit [`e15f1e8`](https://github.com/apache/spark/commit/e15f1e89baac881750d884d182fa317bece41057).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127639 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127639/testReport)** for PR 29438 at commit [`e15f1e8`](https://github.com/apache/spark/commit/e15f1e89baac881750d884d182fa317bece41057).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127471 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127471/testReport)** for PR 29438 at commit [`04ed7d8`](https://github.com/apache/spark/commit/04ed7d884710ba61d02f31c4aac90a5d1e09a9e5).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -371,4 +371,42 @@ class SparkSqlParserSuite extends AnalysisTest {
           ("TOK_TABLEROWFORMATNULL", "NULL")), None, None,
         List.empty, List.empty, None, None, false)))
   }
+  
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       > why does this fail? It's '\n' right?
   
   Scrip in/out, two 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


[GitHub] [spark] SparkQA commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127486 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127486/testReport)** for PR 29438 at commit [`93d6d85`](https://github.com/apache/spark/commit/93d6d857c884e07a350021524086cd5483b165e7).
    * 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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127640 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127640/testReport)** for PR 29438 at commit [`15d6db7`](https://github.com/apache/spark/commit/15d6db7ad06ff673423399863de0baeca8559fb8).
    * 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 removed a comment on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127653 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127653/testReport)** for PR 29438 at commit [`ed60af5`](https://github.com/apache/spark/commit/ed60af531de3787d40f61b7eaf024811860ccb07).


----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29438:
URL: https://github.com/apache/spark/pull/29438#discussion_r472859934



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -330,4 +330,42 @@ class SparkSqlParserSuite extends AnalysisTest {
     assertEqual("ADD FILE /path with space/abc.txt", AddFileCommand("/path with space/abc.txt"))
     assertEqual("ADD JAR /path with space/abc.jar", AddJarCommand("/path with space/abc.jar"))
   }
+
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       If it only supports one value, why do we ever provide a clause to set 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


[GitHub] [spark] cloud-fan closed pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #29438:
URL: https://github.com/apache/spark/pull/29438


   


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] cloud-fan commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #29438:
URL: https://github.com/apache/spark/pull/29438#discussion_r472890018



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -371,4 +371,42 @@ class SparkSqlParserSuite extends AnalysisTest {
           ("TOK_TABLEROWFORMATNULL", "NULL")), None, None,
         List.empty, List.empty, None, None, false)))
   }
+  
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       why does this fail? It's '\n' right?

##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -371,4 +371,42 @@ class SparkSqlParserSuite extends AnalysisTest {
           ("TOK_TABLEROWFORMATNULL", "NULL")), None, None,
         List.empty, List.empty, None, None, false)))
   }
+  
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       ah there are two `LINES TERMINATED BY`. Is it allowed?




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -759,6 +759,12 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {
         def entry(key: String, value: Token): Seq[(String, String)] = {
           Option(value).map(t => key -> t.getText).toSeq
         }
+
+        if (Option(c.linesSeparatedBy).map(string).getOrElse("\n") != "\n") {

Review comment:
       We need to follow this restriction of Hive? IMO its okay to support any char as a line separator normally.




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127653 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127653/testReport)** for PR 29438 at commit [`ed60af5`](https://github.com/apache/spark/commit/ed60af531de3787d40f61b7eaf024811860ccb07).
    * 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] AngersZhuuuu commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   FYI @maropu @cloud-fan 


----------------------------------------------------------------
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] cloud-fan commented on pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on pull request #29438:
URL: https://github.com/apache/spark/pull/29438#issuecomment-676005317


   the fix looks good, can you resolve conflicts?


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -371,4 +371,42 @@ class SparkSqlParserSuite extends AnalysisTest {
           ("TOK_TABLEROWFORMATNULL", "NULL")), None, None,
         List.empty, List.empty, None, None, false)))
   }
+  
+  test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" +
+    " `TOK_TABLEROWFORMATLINES` only support '\\n'") {
+
+      // test input format TOK_TABLEROWFORMATLINES
+      intercept(
+          s"""
+             |SELECT TRANSFORM(a, b, c, d, e)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY ','
+             |  LINES TERMINATED BY '@'
+             |  NULL DEFINED AS 'null'
+             |  USING 'cat' AS (value)
+             |  ROW FORMAT DELIMITED
+             |  FIELDS TERMINATED BY '&'
+             |  LINES TERMINATED BY '\n'

Review comment:
       > why does this fail? It's '\n' right?
   
   Scrip in/out, two format all only support '\n'.  you can see two test case one test script in row format, one test scrip out row format




----------------------------------------------------------------
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] AngersZhuuuu commented on a change in pull request #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -759,6 +759,12 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) {
         def entry(key: String, value: Token): Seq[(String, String)] = {
           Option(value).map(t => key -> t.getText).toSeq
         }
+
+        if (Option(c.linesSeparatedBy).map(string).getOrElse("\n") != "\n") {

Review comment:
       > IMO its okay to support any char as a line separator normally.
   
   In this way ,  line Separator must be a char. since it's hard to write a high-performance Reader (like BufferedReader.getLine) that can get one row data with string line separator . 
   
   if just support char as line delim, we can just rewrite a reader like BufferedReader.
   
   > We need to follow this restriction of Hive?
   
   Script transform's user always come from hive. It ok just to follow hive and this behavior is straight forward and simple.




----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127486 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127486/testReport)** for PR 29438 at commit [`93d6d85`](https://github.com/apache/spark/commit/93d6d857c884e07a350021524086cd5483b165e7).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127472 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127472/testReport)** for PR 29438 at commit [`32fa37c`](https://github.com/apache/spark/commit/32fa37ccab3cfd22eef252297ecf21453012bbd8).


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   **[Test build #127472 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/127472/testReport)** for PR 29438 at commit [`32fa37c`](https://github.com/apache/spark/commit/32fa37ccab3cfd22eef252297ecf21453012bbd8).
    * 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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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


   Merged build finished. Test FAILed.


----------------------------------------------------------------
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 #29438: [SPARK-32607][SQL] Script Transformation ROW FORMAT DELIMITED `TOK_TABLEROWFORMATLINES` only support '\n'

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






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