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