Github user viirya commented on the pull request:

    https://github.com/apache/spark/pull/12138#issuecomment-208158392
  
    @cloud-fan Thanks for comment.
    
    The problem is we re-use child's output as `Expand`s output.  We will 
create new attributes in `Expand` because `Expand` actually performs multiple 
projections. However, we let the projections in `Expand` as `Expression` 
instead of `NamedExpression` and re-use child output attributes. Thus there is 
a inconsistency between `Expand`'s output attributes and projected values.
    
    The obvious example for this inconsistency is constraints. Previously 
`Expand` inherits child's constraints. As we will change child's output values 
by projections (e.g., set it as null), these constraints bound on child's 
attributes are not valid.
    
    In previous PR we just set `Expand`s `validConstraints` to empty to avoid 
such inconsistency. But as the result, we don't have reliable constraints after 
`Expand` operator.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to