jackylee-ch commented on code in PR #9016:
URL: https://github.com/apache/incubator-gluten/pull/9016#discussion_r1999993940
##########
backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala:
##########
@@ -123,6 +123,58 @@ abstract class ScalarFunctionsValidateSuite extends
FunctionsValidateSuite {
}
}
+ testWithSpecifiedSparkVersion("Test array_append function - INT",
Some("3.4")) {
+ withTempPath {
+ path =>
+ Seq[(Array[Int], Int)](
+ (Array(2, 1), 0),
+ (Array(1), 1),
+ (Array(), 0),
+ (Array(1, 2, null.asInstanceOf[Int]), 1),
+ (Array(null.asInstanceOf[Int]), 1)
+ )
+ .toDF("arr", "num")
+ .write
+ .parquet(path.getCanonicalPath)
+
+
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("tbl")
+
+ runQueryAndCompare("select arr, num, array_append(arr, num) from tbl")
{
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+
+ runQueryAndCompare("select array_append(array(), NULL) from tbl") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+
+ runQueryAndCompare("select array_append(array(NULL), NULL) from tbl") {
Review Comment:
These are not suitable cases, as Spark would directly execute them in
optimizer, can we write and read from parquet?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]