marin-ma commented on code in PR #4901:
URL: https://github.com/apache/incubator-gluten/pull/4901#discussion_r1520931741


##########
backends-velox/src/main/scala/io/glutenproject/execution/GenerateExecTransformer.scala:
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.glutenproject.execution
+
+import io.glutenproject.backendsapi.BackendsApiManager
+import io.glutenproject.expression.{ConverterUtils, ExpressionConverter, 
ExpressionNames}
+import io.glutenproject.expression.ConverterUtils.FunctionConfig
+import io.glutenproject.extension.ValidationResult
+import io.glutenproject.metrics.{GenerateMetricsUpdater, MetricsUpdater}
+import io.glutenproject.substrait.`type`.TypeBuilder
+import io.glutenproject.substrait.SubstraitContext
+import io.glutenproject.substrait.expression.{ExpressionBuilder, 
ExpressionNode}
+import io.glutenproject.substrait.extensions.{AdvancedExtensionNode, 
ExtensionBuilder}
+import io.glutenproject.substrait.rel.{RelBuilder, RelNode}
+
+import org.apache.spark.sql.catalyst.expressions._
+import org.apache.spark.sql.execution.SparkPlan
+import org.apache.spark.sql.execution.metric.SQLMetrics
+import org.apache.spark.sql.types.{ArrayType, LongType, MapType, StructType}
+
+import com.google.common.collect.Lists
+import com.google.protobuf.StringValue
+
+import scala.collection.JavaConverters._
+
+case class GenerateExecTransformer(
+    generator: Generator,
+    requiredChildOutput: Seq[Attribute],
+    outer: Boolean,
+    generatorOutput: Seq[Attribute],
+    child: SparkPlan)
+  extends GenerateExecTransformerBase(
+    generator,
+    requiredChildOutput,
+    outer,
+    generatorOutput,
+    child) {
+
+  @transient
+  override lazy val metrics =
+    Map("numOutputRows" -> SQLMetrics.createMetric(sparkContext, "number of 
output rows"))
+
+  override def metricsUpdater(): MetricsUpdater = new 
GenerateMetricsUpdater(metrics)
+
+  override protected def withNewChildInternal(newChild: SparkPlan): 
GenerateExecTransformer =
+    copy(generator, requiredChildOutput, outer, generatorOutput, newChild)
+
+  override protected def doGeneratorValidate(
+      generator: Generator,
+      outer: Boolean): ValidationResult = {
+    if (outer) {
+      return ValidationResult.notOk(s"Velox backend does not support outer")
+    }
+    generator match {
+      case _: JsonTuple =>
+        ValidationResult.notOk(s"Velox backend does not support this 
json_tuple")
+      case e: ExplodeBase =>
+        e.child match {
+          case _: CreateMap =>
+            // explode(MAP(col1, col2))

Review Comment:
   Looks like `CreateMap` is not covered by existing UTs. However, I verified 
locally and found Gluten does support this case. Removed this constraint in the 
latest commit and add UT 
https://github.com/apache/incubator-gluten/pull/4901/commits/131a08cdd8ade0edd0e7a58c2b401e213adb640e
   cc: @liujiayi771 



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