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


##########
gluten-core/src/main/scala/org/apache/gluten/expression/ExpressionConverter.scala:
##########
@@ -656,6 +656,22 @@ object ExpressionConverter extends SQLConfHelper with 
Logging {
           Seq(replaceWithExpressionTransformerInternal(c.child, attributeSeq, 
expressionsMap)),
           c
         )
+      case t: TransformKeys =>
+        // default is `EXCEPTION`
+        val mapKeyDedupPolicy = 
SQLConf.get.getConf(SQLConf.MAP_KEY_DEDUP_POLICY)
+        if (mapKeyDedupPolicy == SQLConf.MapKeyDedupPolicy.LAST_WIN.toString) {
+          // TODO: Remove after fix ready for
+          //  https://github.com/facebookincubator/velox/issues/10219
+          throw new GlutenNotSupportException(
+            "Not support to handle the cases if duplicate map keys exists 
after transform" +

Review Comment:
   Maybe, better to simplify the message like: "LAST_WIN policy is not 
supported to deduplicate map keys.".



##########
gluten-ut/spark35/src/test/scala/org/apache/spark/sql/catalyst/expressions/GlutenHigherOrderFunctionsSuite.scala:
##########
@@ -16,6 +16,101 @@
  */
 package org.apache.spark.sql.catalyst.expressions
 
+import org.apache.spark.SparkRuntimeException
 import org.apache.spark.sql.GlutenTestsTrait
+import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
+import org.apache.spark.sql.internal.SQLConf
+import org.apache.spark.sql.types.{IntegerType, MapType, StringType}
 
-class GlutenHigherOrderFunctionsSuite extends HigherOrderFunctionsSuite with 
GlutenTestsTrait {}
+class GlutenHigherOrderFunctionsSuite extends HigherOrderFunctionsSuite with 
GlutenTestsTrait {
+  import org.apache.spark.sql.catalyst.dsl.expressions._
+  testGluten("TransformKeys") {

Review Comment:
   Please leave some comment to let developer know what the main changes were 
made, compared with Spark's test.
   
   Curious why only spark-3.5 needs this change.



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