Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6982#discussion_r33496840
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ExtractValue.scala
 ---
    @@ -195,6 +240,20 @@ case class GetArrayItem(child: Expression, ordinal: 
Expression)
           baseValue(index)
         }
       }
    +
    +  override def genCode(ctx: CodeGenContext, ev: GeneratedExpressionCode): 
String = {
    +    val castToInt = if (ordinal.dataType == LongType) "(int)" else ""
    --- End diff --
    
    In order to support other numeric types, I'd like to cast it into `int` 
when `ordinal.dataType` is not `IntegerType`.
    
    Btw, maybe we could always cast it into `int`, the Java compiler and JIT 
may could avoid the unnecessary casting for us.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to