holdenk commented on code in PR #45146:
URL: https://github.com/apache/spark/pull/45146#discussion_r1502956339
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/FilterPushdownSuite.scala:
##########
@@ -882,6 +882,30 @@ class FilterPushdownSuite extends PlanTest {
comparePlans(optimized, correctAnswer)
}
+ test("union part 2 electric razor idk") {
+ val nonNullableArray = StructField("a", ArrayType(IntegerType, false))
+ val bField = StructField("b", IntegerType)
+ val testRelationNonNull = LocalRelation(nonNullableArray, bField)
+ val testRelationNull = LocalRelation($"c".array(IntegerType), $"d".int)
+
+ val nonNullArrayRef = AttributeReference("a", ArrayType(IntegerType,
false))(
+ testRelationNonNull.output(0).exprId, List())
+
+
+ val originalQuery = Union(Seq(testRelationNonNull, testRelationNull))
+ .where(IsNotNull(nonNullArrayRef))
Review Comment:
Right so in the "real world" I think the way one would do it is with the
data frame API and writing a filter referencing the original sub data frame but
on the unions output. It's... a very weird corner case but one I've seen in
production.
--
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]