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

Catalog recoverPartitions should allow specifying the database name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.1.0
    • None
    • SQL

    Description

      Currently Catalog.recoverParitions only has a tableName parameter

      https://github.com/apache/spark/blob/9effc2cdcb3d68db8b6b5b3abd75968633b583c8/sql/core/src/main/scala/org/apache/spark/sql/catalog/Catalog.scala#L397

      But it throws an exception when the table is not in the default database.

      Caused by: org.apache.spark.sql.catalyst.analysis.NoSuchTableException: Table or view 'foo' not found in database 'default';
      at org.apache.spark.sql.catalyst.catalog.SessionCatalog.requireTableExists(SessionCatalog.scala:154)
      at org.apache.spark.sql.catalyst.catalog.SessionCatalog.getTableMetadata(SessionCatalog.scala:317)
      at org.apache.spark.sql.execution.command.AlterTableRecoverPartitionsCommand.run(ddl.scala:563)
      at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:58)
      at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:56)
      at org.apache.spark.sql.execution.command.ExecutedCommandExec.doExecute(commands.scala:74)
      at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:114)
      at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$1.apply(SparkPlan.scala:114)
      at org.apache.spark.sql.execution.SparkPlan$$anonfun$executeQuery$1.apply(SparkPlan.scala:135)
      at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
      at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:132)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              felixcheung Felix Cheung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: