[
https://issues.apache.org/jira/browse/TAJO-1644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14598708#comment-14598708
]
ASF GitHub Bot commented on TAJO-1644:
--------------------------------------
Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/601#discussion_r33110868
--- Diff:
tajo-storage/tajo-storage-hdfs/src/main/java/org/apache/tajo/storage/FileTablespace.java
---
@@ -894,7 +894,12 @@ protected Path commitOutputData(OverridableConf
queryContext, boolean changeFile
Path oldTableDir = new Path(stagingDir,
TajoConstants.INSERT_OVERWIRTE_OLD_TABLE_NAME);
ContentSummary summary = fs.getContentSummary(stagingResultDir);
- if (!queryContext.get(QueryVars.OUTPUT_PARTITIONS, "").isEmpty()
&& summary.getFileCount() > 0L) {
+ // When inserting empty data into a partitioned table, check if
keep existing data need to be remove or not.
+ boolean keptEnabled =
queryContext.getBool(SessionVars.TABLE_PARTITION_KEPT_EXISTING_DATA_ENABLED);
+
+ // If existing data doesn't need to keep, check if there are
some files.
+ if ( (!queryContext.get(QueryVars.OUTPUT_PARTITIONS,
"").isEmpty())
--- End diff --
This condition should be changed depending on the changed default value.
> When inserting empty data into a partitioned table, existing data would be
> removed.
> -----------------------------------------------------------------------------------
>
> Key: TAJO-1644
> URL: https://issues.apache.org/jira/browse/TAJO-1644
> Project: Tajo
> Issue Type: Bug
> Components: query master
> Reporter: Jaehwa Jung
> Assignee: Jaehwa Jung
> Fix For: 0.11.0, 0.10.2
>
> Attachments: TAJO-1644.patch, TAJO-1644_2.patch
>
>
> When inserting empty data into a partitioned table, existing data would be
> removed. Tajo provides column value partition which is hive-style partition.
> In hive, when inserting empty data into a partition, there are two cases. If
> you use dynamic partitions, existing data never would be removed. But if you
> don't use dynamic partitions, existing data would be removed. When inserting
> a data to partition, tajo user don't specify each column and each column
> value. So, it is similar to dynamic partition of hive. It seems to update
> deletion logic of partitioned table.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)