Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33392 Align DSv2 commands to DSv1 implementation
  3. SPARK-33676

Require exact matched partition spec to schema in ADD/DROP PARTITION

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • SQL
    • None

    Description

      The V1 implementation of ALTER TABLE .. ADD/DROP PARTITION fails when the partition spec doesn't exactly match to the partition schema:

      ALTER TABLE tab1 ADD PARTITION (A='9')
      Partition spec is invalid. The spec (a) must match the partition spec (a, b) defined in table '`dbx`.`tab1`';
      org.apache.spark.sql.AnalysisException: Partition spec is invalid. The spec (a) must match the partition spec (a, b) defined in table '`dbx`.`tab1`';
      	at org.apache.spark.sql.catalyst.catalog.SessionCatalog.$anonfun$requireExactMatchedPartitionSpec$1(SessionCatalog.scala:1173)
      	at org.apache.spark.sql.catalyst.catalog.SessionCatalog.$anonfun$requireExactMatchedPartitionSpec$1$adapted(SessionCatalog.scala:1171)
      	at scala.collection.immutable.List.foreach(List.scala:392)
      

      for a table partitioned by "a", "b" but the V2 implementation add the wrong partition silently.

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: