fqaiser94 edited a comment on pull request #27066:
URL: https://github.com/apache/spark/pull/27066#issuecomment-633258362
@cloud-fan Thanks for your suggestion.
While I was initially opposed to this idea, I've since changed my mind and
made the relevant changes to accommodate this feature request.
Please note there were a couple of new edge cases which I handled as
follows:
1. In your example (`$"a".withField("b.a", lit(5))`) what if the
intermediate field `b` does not exist?
~In the current implementation, I create a new struct named `b` with only
one field `a`.~ Changed my mind, this will throw an `AnalysisException` to be
consistent with the other edge case below.
2. In your example (`$"a".withField("b.a", lit(5))`) what if the
intermediate field `b` exists but is not a `StructType`?
In the current implementation, I throw an `AnalysisException` as `WithField`
is intended to be used for adding/replacing fields in structs .
Open to hearing people's thoughts on the latest changes.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]