Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16583#discussion_r96122416
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala 
---
    @@ -247,6 +247,16 @@ class HiveDDLSuite
         }
       }
     
    +  test("SPARK-19129: drop partition with a empty string will drop the 
whole table") {
    +    val df = spark.createDataFrame(Seq((0, "a"), (1, 
"b"))).toDF("partCol1", "name")
    +    
df.write.mode("overwrite").partitionBy("partCol1").saveAsTable("partitionedTable")
    +    val e = intercept[AnalysisException] {
    +      spark.sql("alter table partitionedTable drop partition(partCol1='')")
    --- End diff --
    
    @tejasapatil Thank you for your research
    
    So far, we are not completely following Hive in the partition-related DDL 
commands. `DROP PARTITION` is an example. If the users-specified spec does not 
exist, we will throw an exception. Instead, Hive just silently ignores it 
without any exception, but Hive will always report which partition is dropped 
after the command. Thus, maybe we can improve this in the future PR.
    
    Thus, this PR is to follow the same way to block the invalid inputs. That 
is, throwing an exception when the input partition spec is not valid. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to