comphead commented on code in PR #4677:
URL: https://github.com/apache/datafusion-comet/pull/4677#discussion_r3436913514


##########
spark/src/main/scala/org/apache/comet/serde/arrays.scala:
##########
@@ -583,6 +582,14 @@ object CometElementAt extends 
CometExpressionSerde[ElementAt] {
   override def getUnsupportedReasons(): Seq[String] = Seq(
     "Input must be an array. `Map` inputs are not supported.")
 
+  override def getSupportLevel(expr: ElementAt): SupportLevel = {
+    if (expr.left.dataType.isInstanceOf[ArrayType]) {

Review Comment:
   in Apache Spark, the ElementAt supports Map, and Comet gates for Array only, 
we should support Map
   
   ```
     override def inputTypes: Seq[AbstractDataType] = {
       (left.dataType, right.dataType) match {
         case (arr: ArrayType, e2: IntegralType) if (e2 != LongType) =>
           Seq(arr, IntegerType)
         case (MapType(keyType, valueType, hasNull), e2) =>
           TypeCoercion.findTightestCommonType(keyType, e2) match {
             case Some(dt) => Seq(MapType(dt, valueType, hasNull), dt)
             case _ => Seq.empty
           }
         case (l, r) => Seq.empty
   
       }
     }
   ```



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