You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Anand Kannachikandy (Jira)" <ji...@apache.org> on 2022/02/12 05:49:00 UTC
[jira] [Comment Edited] (SPARK-20236) Overwrite a partitioned data source table should only overwrite related partitions
[ https://issues.apache.org/jira/browse/SPARK-20236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17491265#comment-17491265 ]
Anand Kannachikandy edited comment on SPARK-20236 at 2/12/22, 5:48 AM:
-----------------------------------------------------------------------
[~cloud_fan] Have anyone tested this in HDP Clusters, I'm getting the same issue as [~doriwal] , its works well in my local machine, but when I run this HDP cluster, the folder doesn't have any partitions created at all, all I can see is a _SUCCESS file created in the path; and If set this to static the partition folders are getting created.
I'm running my code on spark 2.3.0 version and hip version 2.6.5
my sample code looks like below
{code:java}
dF
.write
.mode("overwrite")
.partitionBy("Year","Month")
.parquet(<Parquet-Path>) {code}
Appreciate your inputs
was (Author: JIRAUSER285114):
[~cloud_fan] Have anyone tested this in HDP Clusters, I'm getting the same issue as [~doriwal] , its works well in my local machine, but when I run this HDP cluster, the folder doesn't have any partitions created at all, all I can see is a _SUCCESS file created in the path; and If set this to static the partition folders are getting created.
I'm running my code on spark 2.3.0 version and hip version 2.6.5
my sample code looks like below
{code:java}
// dF
.write
.mode("overwrite")
.partitionBy("Year","Month")
.parquet(<Parquet-Path>) {code}
Appreciate your inputs
> Overwrite a partitioned data source table should only overwrite related partitions
> ----------------------------------------------------------------------------------
>
> Key: SPARK-20236
> URL: https://issues.apache.org/jira/browse/SPARK-20236
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.2.0
> Reporter: Wenchen Fan
> Assignee: Wenchen Fan
> Priority: Major
> Labels: releasenotes
> Fix For: 2.3.0
>
>
> When we overwrite a partitioned data source table, currently Spark will truncate the entire table to write new data, or truncate a bunch of partitions according to the given static partitions.
> For example, {{INSERT OVERWRITE tbl ...}} will truncate the entire table, {{INSERT OVERWRITE tbl PARTITION (a=1, b)}} will truncate all the partitions that starts with {{a=1}}.
> This behavior is kind of reasonable as we can know which partitions will be overwritten before runtime. However, hive has a different behavior that it only overwrites related partitions, e.g. {{INSERT OVERWRITE tbl SELECT 1,2,3}} will only overwrite partition {{a=2, b=3}}, assuming {{tbl}} has only one data column and is partitioned by {{a}} and {{b}}.
> It seems better if we can follow hive's behavior.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org