PHILO-HE commented on code in PR #9305:
URL: https://github.com/apache/incubator-gluten/pull/9305#discussion_r2043415566


##########
backends-velox/src/main/scala/org/apache/gluten/backendsapi/velox/VeloxSparkPlanExecApi.scala:
##########
@@ -294,6 +294,19 @@ class VeloxSparkPlanExecApi extends SparkPlanExecApi {
     GenericExpressionTransformer(newSubstraitName, children, newExpr)
   }
 
+  override def genArrayInsertTransformer(
+      substraitExprName: String,
+      children: Seq[ExpressionTransformer],
+      original: Expression): ExpressionTransformer = {
+    children match {
+      case Seq(left, posExpr, right, _) if posExpr.original == Literal(1) =>
+        // transformer to array_prepend implement in velox

Review Comment:
   Nit: remove this comment or rephrase it like: Transformer for array_prepend. 
 (follow community comment style: capitalize initial letter and end up with 
period).



##########
backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala:
##########
@@ -172,6 +172,31 @@ abstract class ScalarFunctionsValidateSuite extends 
FunctionsValidateSuite {
     }
   }
 
+  testWithMinSparkVersion("Test array_prepend function", "3.5") {
+    withTempPath {
+      path =>
+        Seq[(Array[String], String)](
+          (Array("a", "b"), "c"),
+          (Array("a"), "b"),
+          (Array(), "a"),
+          (Array("a", "b", null.asInstanceOf[String]), "c"),
+          (Array(null.asInstanceOf[String]), "a"),
+          (Array(null.asInstanceOf[String]), null.asInstanceOf[String]),
+          (Array(), null.asInstanceOf[String])
+        )
+          .toDF("arr", "txt")
+          .write
+          .parquet(path.getCanonicalPath)
+
+        
spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("tbl")
+
+        runQueryAndCompare("select arr, txt, array_prepend(arr, txt) from 
tbl") {
+          checkGlutenOperatorMatch[ProjectExecTransformer]
+        }
+        sql("select arr, txt, array_prepend(arr, txt) from tbl").explain()

Review Comment:
   Nit: seems no need to output explain. Please remove it.



-- 
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]

Reply via email to