dtenedor commented on PR #36212:
URL: https://github.com/apache/spark/pull/36212#issuecomment-1119115713
@morvenhuang @gengliangwang there might be a bug in this. Should this:
```
case SubqueryAlias(_, r: View) if r.isTempView =>
StructType(r.schema.fields.dropRight(
enclosingInsert.get.partitionSpec.size))
```
really be this?
```
case SubqueryAlias(_, r: View) if r.isTempView =>
StructType(r.desc.schema.fields.dropRight(
enclosingInsert.get.partitionSpec.size))
```
The `r.schema` may trigger an exception if the view is not resolved, whereas
`r.desc.schema` should always work. Should we consider a follow up patch to fix?
<img width="599" alt="image"
src="https://user-images.githubusercontent.com/99207096/167040368-a11d5fe2-6d71-4b98-9be9-69081d2a3d31.png">
--
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]