MaxGekk commented on pull request #31265:
URL: https://github.com/apache/spark/pull/31265#issuecomment-765266349
> BTW do you know whether the refreshTable method is used in places where
there could be both temp view and table with the same name and we explicitly do
not want to refresh the temp view but just the table relation cache?
Theoretically, I could imagine the situation when an user run any v1 command
for a table, for instance `ALTER TABLE tbl DROP PARTITION`, and `tbl` is
resolved to a v1 table:
```scala
case class AlterTableDropPartitionCommand(
tableName: TableIdentifier,
...
```
`tableName` refers to `tbl`. While running the command, the user creates a
temp view `tbl` in a parallel thread somewhere in the middle of `run()`:
```scala
override def run(sparkSession: SparkSession): Seq[Row] = {
val table = catalog.getTableMetadata(tableName)
...
// USER CREATES A TEMP VIEW WITH THE SAME NAME
...
sparkSession.catalog.refreshTable(table.identifier.quotedString)
```
And at the end of `run()`, we refresh the view instead of the table.
----------------------------------------------------------------
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]