This is an automated email from the ASF dual-hosted git repository.

wenchen pushed a commit to branch branch-3.5
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.5 by this push:
     new 39c732f89cd [SPARK-43839][SQL][FOLLOWUP] Convert 
_LEGACY_ERROR_TEMP_1337 to UNSUPPORTED_FEATURE.TIME_TRAVEL
39c732f89cd is described below

commit 39c732f89cdbd89c3e8bc39cf233eba338ad705a
Author: panbingkun <pbk1...@gmail.com>
AuthorDate: Thu Jul 20 17:44:14 2023 +0800

    [SPARK-43839][SQL][FOLLOWUP] Convert _LEGACY_ERROR_TEMP_1337 to 
UNSUPPORTED_FEATURE.TIME_TRAVEL
    
    ### What changes were proposed in this pull request?
    - The pr is following up https://github.com/apache/spark/pull/41349.
    - The pr aims to simplify code logic after merge `_LEGACY_ERROR_TEMP_1337` 
to `UNSUPPORTED_FEATURE.TIME_TRAVEL`.
    
    ### Why are the changes needed?
    Simplify code logic.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Pass GA.
    
    Closes #42082 from panbingkun/SPARK-43839_FOLLOWUP.
    
    Authored-by: panbingkun <pbk1...@gmail.com>
    Signed-off-by: Wenchen Fan <wenc...@databricks.com>
    (cherry picked from commit 6700f3ce8b1020186a2f0871caecb74354650922)
    Signed-off-by: Wenchen Fan <wenc...@databricks.com>
---
 .../sql/execution/datasources/v2/V2SessionCatalog.scala  | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala
index f311ccbb630..a7062a9a596 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalog.scala
+++ 
b/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
     }
+    throw QueryCompilationErrors.timeTravelUnsupportedError(toSQLId(nameParts))
   }
 
   override def invalidateTable(ident: Identifier): Unit = {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to