Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16621#discussion_r96576872
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
 ---
    @@ -586,12 +594,12 @@ class SessionCatalog(
                 desc = metadata,
                 output = metadata.schema.toAttributes,
                 child = parser.parsePlan(viewText))
    -          SubqueryAlias(relationAlias, child, Option(name))
    +          SubqueryAlias(relationAlias, child, Some(name.copy(table = 
table, database = Some(db))))
             } else {
               SubqueryAlias(relationAlias, SimpleCatalogRelation(metadata), 
None)
             }
           } else {
    -        SubqueryAlias(relationAlias, tempTables(table), Option(name))
    +        SubqueryAlias(relationAlias, tempTables(table), None)
    --- End diff --
    
    the existing way is to set `None`, see 
https://github.com/apache/spark/pull/16621/files#diff-ca4533edbf148c89cc0c564ab6b0aeaaL75
    
    This shows the evil of duplicated code, we have inconsistent behaviors 
without and without hive support. I think we should only set table identifier 
for persisted view, @hvanhovell is that 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.
---

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

Reply via email to