You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2017/01/13 20:51:26 UTC

[jira] [Assigned] (SPARK-19129) alter table table_name drop partition with a empty string will drop the whole table

     [ https://issues.apache.org/jira/browse/SPARK-19129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiao Li reassigned SPARK-19129:
-------------------------------

    Assignee: Xiao Li

> alter table table_name drop partition with a empty string will drop the whole table
> -----------------------------------------------------------------------------------
>
>                 Key: SPARK-19129
>                 URL: https://issues.apache.org/jira/browse/SPARK-19129
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: lichenglin
>            Assignee: Xiao Li
>              Labels: correctness
>
> {code}
>     val spark = SparkSession
>       .builder
>       .appName("PartitionDropTest")
>       .master("local[2]").enableHiveSupport()
>       .getOrCreate()
>     val sentenceData = spark.createDataFrame(Seq(
>       (0, "a"),
>       (1, "b"),
>       (2, "c")))
>       .toDF("id", "name")
>     spark.sql("drop table if exists licllocal.partition_table")
>     sentenceData.write.mode(SaveMode.Overwrite).partitionBy("id").saveAsTable("licllocal.partition_table")
>     spark.sql("alter table licllocal.partition_table drop partition(id='')")
>     spark.table("licllocal.partition_table").show()
> {code}
> the result is 
> {code}
> |name| id|
> +----+---+
> +----+---+
> {code}
> Maybe the partition match have something wrong when the partition value is set to empty string



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org