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.


---
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.
---

Reply via email to