Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-45383

Missing case for RelationTimeTravel in CheckAnalysis

    XMLWordPrintableJSON

Details

    Description

      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, rather than the expected AnalysisException:

      [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) 

      Fix should be simple enough:

      case tt: RelationTimeTravel =>
        checkAnalysis0(tt.table) 

      Attachments

        Issue Links

          Activity

            People

              cloud_fan Wenchen Fan
              ryan.johnson@databricks.com Ryan Johnson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: