You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2023/07/20 02:48:54 UTC

[GitHub] [spark] panbingkun commented on a diff in pull request #42082: [SPARK-43839][SQL][FOLLOWUP] Convert _LEGACY_ERROR_TEMP_1337 to UNSUPPORTED_FEATURE.TIME_TRAVEL

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org