cloud-fan commented on a change in pull request #27187: [SPARK-30497][SQL] migrate DESCRIBE TABLE to the new framework URL: https://github.com/apache/spark/pull/27187#discussion_r366233395
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -759,6 +759,8 @@ class Analyzer( u.failAnalysis(s"${ident.quoted} is a temp view not table.") } u + case u @ UnresolvedTableOrView(ident) => + lookupTempView(ident).getOrElse(u) Review comment: some commands don't need to scan the table/view (like DESCRIBE). If we use `UnresolvedRelation`, then we will end up with `DataSourceV2ScanRelation`, which creates `Scan` from `Table` and is not necessary. Another problem is view. `UnresolvedRelation` can be resolved to `View`, and then get removed at the beginning of optimizer. I'll think of how to overcome these issues and reuse `UnresolvedRelation`. ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org