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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]