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

Fix misleading message for uncaching when createOrReplaceTempView is called

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • SQL
    • None

    Description

      To repro:

      scala> sql("CREATE TABLE table USING parquet AS SELECT 2")
      res0: org.apache.spark.sql.DataFrame = []                                       
      
      scala> val df = spark.table("table")
      df: org.apache.spark.sql.DataFrame = [2: int]
      
      scala> df.createOrReplaceTempView("t2")
      20/12/04 10:16:24 WARN CommandUtils: Exception when attempting to uncache $name
      org.apache.spark.sql.AnalysisException: Table or view not found: t2;;
      'UnresolvedRelation [t2], [], false
      
      	at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis$1(CheckAnalysis.scala:113)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis$1$adapted(CheckAnalysis.scala:93)
      	at org.apache.spark.sql.catalyst.trees.TreeNode.foreachUp(TreeNode.scala:183)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.checkAnalysis(CheckAnalysis.scala:93)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.checkAnalysis$(CheckAnalysis.scala:90)
      	at org.apache.spark.sql.catalyst.analysis.Analyzer.checkAnalysis(Analyzer.scala:152)
      	at org.apache.spark.sql.catalyst.analysis.Analyzer.$anonfun$executeAndCheck$1(Analyzer.scala:172)
      	at org.apache.spark.sql.catalyst.plans.logical.AnalysisHelper$.markInAnalyzer(AnalysisHelper.scala:214)
      	at org.apache.spark.sql.catalyst.analysis.Analyzer.executeAndCheck(Analyzer.scala:169)
      	at org.apache.spark.sql.execution.QueryExecution.$anonfun$analyzed$1(QueryExecution.scala:73)
      	at org.apache.spark.sql.catalyst.QueryPlanningTracker.measurePhase(QueryPlanningTracker.scala:111)
      	at org.apache.spark.sql.execution.QueryExecution.$anonfun$executePhase$1(QueryExecution.scala:138)
      	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:768)
      	at org.apache.spark.sql.execution.QueryExecution.executePhase(QueryExecution.scala:138)
      	at org.apache.spark.sql.execution.QueryExecution.analyzed$lzycompute(QueryExecution.scala:73)
      	at org.apache.spark.sql.execution.QueryExecution.analyzed(QueryExecution.scala:71)
      	at org.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:63)
      	at org.apache.spark.sql.Dataset$.$anonfun$ofRows$1(Dataset.scala:90)
      	at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:768)
      	at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:88)
      	at org.apache.spark.sql.DataFrameReader.table(DataFrameReader.scala:889)
      	at org.apache.spark.sql.SparkSession.table(SparkSession.scala:589)
      	at org.apache.spark.sql.internal.CatalogImpl.uncacheTable(CatalogImpl.scala:476)
      	at org.apache.spark.sql.execution.command.CommandUtils$.uncacheTableOrView(CommandUtils.scala:392)
      	at org.apache.spark.sql.execution.command.CreateViewCommand.run(views.scala:124)
      
      

      It shouldn't log because `t2` does not exist yet.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            imback82 Terry Kim
            imback82 Terry Kim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment