panbingkun commented on code in PR #42082:
URL: https://github.com/apache/spark/pull/42082#discussion_r1268872155
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala:
##########
@@ -88,19 +88,11 @@ class V2SessionCatalog(catalog: SessionCatalog)
}
private def failTimeTravel(ident: Identifier, t: Table): Table = {
- t match {
- case V1Table(catalogTable) =>
- if (catalogTable.tableType == CatalogTableType.VIEW) {
- throw QueryCompilationErrors.timeTravelUnsupportedError(
- toSQLId(catalogTable.identifier.nameParts))
- } else {
- throw QueryCompilationErrors.timeTravelUnsupportedError(
- toSQLId(catalogTable.identifier.nameParts))
- }
-
- case _ => throw QueryCompilationErrors.timeTravelUnsupportedError(
- toSQLId(ident.asTableIdentifier.nameParts))
+ val nameParts = t match {
+ case V1Table(catalogTable) => catalogTable.identifier.nameParts
+ case _ => ident.asTableIdentifier.nameParts
Review Comment:
If the code here is simplified as follows:
`val nameParts = ident.asTableIdentifier.nameParts`
in some scenarios, `relationId` will not attach catalog name in the error
message, such as:
https://github.com/apache/spark/blob/e0c79c637c16df92aa3c6fb14f151132ea26e92f/sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala#L979-L990
--
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]