cloud-fan commented on code in PR #45146:
URL: https://github.com/apache/spark/pull/45146#discussion_r1503505250


##########
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, it doesn't hurt to look at expr id only here. It won't change the 
behavior.
   
   After a second thought, `UpdateAttributeNullability` is also called in the 
optimizer, so it's safer to make changes to the filter pushdown rule.



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

Reply via email to