You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/25 00:36:48 UTC

[GitHub] dongjoon-hyun commented on a change in pull request #23867: [SPARK-26965][SQL] Makes ElementAt nullability more precise

dongjoon-hyun commented on a change in pull request #23867: [SPARK-26965][SQL] Makes ElementAt nullability more precise
URL: https://github.com/apache/spark/pull/23867#discussion_r259651201
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala
 ##########
 @@ -216,24 +216,15 @@ case class GetArrayStructFields(
 }
 
 /**
- * Returns the field at `ordinal` in the Array `child`.
- *
- * We need to do type checking here as `ordinal` expression maybe unresolved.
+ * Common trait for [[GetArrayItem]] and [[ElementAt]].
  */
-case class GetArrayItem(child: Expression, ordinal: Expression)
-  extends BinaryExpression with ExpectsInputTypes with ExtractValue with NullIntolerant {
-
-  // We have done type checking for child in `ExtractValue`, so only need to check the `ordinal`.
-  override def inputTypes: Seq[AbstractDataType] = Seq(AnyDataType, IntegralType)
-
-  override def toString: String = s"$child[$ordinal]"
-  override def sql: String = s"${child.sql}[${ordinal.sql}]"
+trait GetArrayItemUtil extends BinaryExpression {
 
 Review comment:
   Can we move this after `case class GetArrayItem` to reduce the diff?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org