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

    https://github.com/apache/spark/pull/482#discussion_r12292598
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala
 ---
    @@ -40,23 +41,27 @@ case class GetItem(child: Expression, ordinal: 
Expression) extends Expression {
       override def toString = s"$child[$ordinal]"
     
       override def eval(input: Row): Any = {
    -    if (child.dataType.isInstanceOf[ArrayType]) {
    -      val baseValue = child.eval(input).asInstanceOf[Seq[_]]
    -      val o = ordinal.eval(input).asInstanceOf[Int]
    -      if (baseValue == null) {
    -        null
    -      } else if (o >= baseValue.size || o < 0) {
    -        null
    -      } else {
    -        baseValue(o)
    -      }
    +    val value = child.eval(input)
    +    if(value == null) {
    --- End diff --
    
    Space after `if`, below too.


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

Reply via email to