Ryan Johnson created SPARK-45383:
------------------------------------

             Summary: Missing case for RelationTimeTravel in CheckAnalysis
                 Key: SPARK-45383
                 URL: https://issues.apache.org/jira/browse/SPARK-45383
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.5.0
            Reporter: Ryan Johnson


{{CheckAnalysis.checkAnalysis0}} lacks a case for {{{}RelationTimeTravel{}}}, 
and since the latter is (intentionally) an {{UnresolvedLeafNode}} rather than a 
{{{}UnaryNode{}}}, the existing checks do not traverse it.

Result: Attempting time travel over a non-existing table produces a spark 
internal error from the [default 
case|https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala#L818],
 rather than the expected {{{}AnalysisException{}}}:
{code:java}
[info]   Cause: org.apache.spark.SparkException: [INTERNAL_ERROR] Found the 
unresolved operator: 'RelationTimeTravel 'UnresolvedRelation [not_exists], [], 
false, 0
[info]   at 
org.apache.spark.SparkException$.internalError(SparkException.scala:77)
[info]   at 
org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis0$54(CheckAnalysis.scala:753)
 {code}
Solution should be simple enough:
{code:java}
case tt: RelationTimeTravel =>
  checkAnalysis0(tt.table) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to