Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/20024#discussion_r157911581
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
---
@@ -2775,4 +2775,42 @@ class SQLQuerySuite extends QueryTest with
SharedSQLContext {
}
}
}
+
+ test("SPARK-22825 Cast array to string") {
+ // Check non-codegen path
+ val df1 = sql("SELECT CAST(ARRAY(1, 2, 3, 4) AS STRING)")
+ checkAnswer(df1, Row("[1, 2, 3, 4]"))
+ val df2 = sql("SELECT CAST(ARRAY(ARRAY(1, 2), ARRAY(3, 4, 5), ARRAY(6,
7)) AS STRING)")
+ checkAnswer(df2, Row("[WrappedArray(1, 2), WrappedArray(3, 4, 5),
WrappedArray(6, 7)]"))
--- End diff --
ok, thanks!
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]