maropu 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_r259653824
##########
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:
Yea, sure!
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]