ulysses-you commented on code in PR #36983:
URL: https://github.com/apache/spark/pull/36983#discussion_r906912293
##########
sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala:
##########
@@ -647,15 +647,15 @@ class CatalogImpl(sparkSession: SparkSession) extends
Catalog {
* @since 2.0.0
*/
override def refreshTable(tableName: String): Unit = {
- val tableIdent =
sparkSession.sessionState.sqlParser.parseTableIdentifier(tableName)
- val relation = sparkSession.table(tableIdent).queryExecution.analyzed
+ val relation = sparkSession.table(tableName).queryExecution.analyzed
relation.refresh()
+ val ident =
sparkSession.sessionState.sqlParser.parseMultipartIdentifier(tableName)
// Temporary and global temporary views are not supposed to be put into
the relation cache
// since they are tracked separately.
- if (!sessionCatalog.isTempView(tableIdent)) {
- sessionCatalog.invalidateCachedTable(tableIdent)
+ if (!sessionCatalog.isTempView(ident)) {
+ sessionCatalog.invalidateCachedTable(makeTableIdentifier(ident))
Review Comment:
TableCatalog has its own `invalidateTable` so it seems we can not only do it
with session catalog. An option may be: construct a `RefreshTable` and call
`sessionState.executePlan(RefreshTable)`, so the analyzer can decide use which
catalog, i.e. session catalog or other catalog.
--
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]