cloud-fan commented on code in PR #45146:
URL: https://github.com/apache/spark/pull/45146#discussion_r1502878311
##########
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:
I'm a bit confused about how such logical plans can be generated in the real
world. Ideally the expressions in a query plan node can only references
attributes from its children nodes. The `Filter` here should only references
attributes from `Union.output`, but `nonNullArrayRef` is not from
`Union.output`.
--
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]