AngersZhuuuu commented on a change in pull request #30946:
URL: https://github.com/apache/spark/pull/30946#discussion_r549752294
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala
##########
@@ -501,4 +501,28 @@ class HiveScriptTransformationSuite extends
BaseScriptTransformationSuite with T
""".stripMargin)
checkAnswer(query4, identity, Row(null) :: Nil)
}
+
+ test("SPARK-32684: Script transform hive serde mode null format is same with
hive as '\\N'") {
+ val query1 = sql(
+ """
+ |SELECT TRANSFORM(null, null, null)
+ |USING 'cat'
+ |FROM (SELECT 1 AS a, 2 AS b, 3 AS c) t
+ """.stripMargin)
+ checkAnswer(query1, identity, Row(null, "\\N\t\\N") :: Nil)
+
+ val query2 = sql(
+ """
+ |SELECT TRANSFORM(null, null, null)
+ | ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
+ |USING 'cat'
+ | ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
+ | WITH SERDEPROPERTIES (
+ | 'serialization.last.column.takes.rest' = 'true'
Review comment:
> Why do we need this conf in this test?
Updated, more clear now?
----------------------------------------------------------------
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]