Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/482#discussion_r12265587
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala ---
    @@ -114,37 +114,37 @@ package object dsl {
           def attr = analysis.UnresolvedAttribute(s)
     
           /** Creates a new AttributeReference of type boolean */
    -      def boolean = AttributeReference(s, BooleanType, nullable = false)()
    --- End diff --
    
    I think "def boolean" / "def string" should return an Attribute with 
nullability = true, that does not harm for the correctness, otherwise, it may 
bring a wrong hint for the optimization of rule NullPropagation.
    
    For example:
    val row = new GenericRow(Array[Any]("a", null))
    val c1 = 'a.string.at(0) 
    val c2 = 'b.string.at(1) // nullable should be true, otherwise does't 
reflect the real situation.
    assert(evaluate(IsNull(c2), row) == true)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to