HeartSaVioR edited a comment on pull request #28326:
URL: https://github.com/apache/spark/pull/28326#issuecomment-619751876


   > Sometimes we have to, for example, a + b as c, what should be the metadata 
of c?
   
   The metadata of expression for `a + b` if there's no explicit set of 
metadata. That's the role of `+` operator defining metadata how to merge two 
metadata into one, or simply discard both.
   
   I'm not referring about explicit set of metadata: that's pretty natural to 
be overwritten because they want to. The issue is not the case.
   
   > For example, a as c, if users do not specify the metadata of c explicitly, 
it should inherit metadata from a.
   
   Here `a` is unresolved attribute in this case which will be replaced with 
actual attribute later. Can metadata of Alias be resolved while origin 
attribute is not resolved yet? (Except the case where explicit metadata is 
available.)
   
   Retrieving metadata of chained Alias simply works as it does find the 
underlying attribute via recursive manner. That said, I'm not seeing the bug in 
such rule the PR is about to fix. If Alias does provide metadata correctly, it 
should work and the fix would be simpler (one-liner).


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to