[ 
https://issues.apache.org/jira/browse/TAJO-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14647645#comment-14647645
 ] 

ASF GitHub Bot commented on TAJO-1346:
--------------------------------------

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

    https://github.com/apache/tajo/pull/630#discussion_r35871956
  
    --- Diff: 
tajo-catalog/tajo-catalog-drivers/tajo-hive/src/main/java/org/apache/tajo/catalog/store/HiveCatalogStore.java
 ---
    @@ -957,6 +1026,54 @@ private boolean existColumn(final String databaseName 
,final String tableName ,
       }
     
       @Override
    +  public void addPartitions(String databaseName, String tableName, 
List<CatalogProtos.PartitionDescProto> partitions
    +    , boolean ifNotExists) throws CatalogException {
    +    HiveCatalogStoreClientPool.HiveCatalogStoreClient client = null;
    +    List<Partition> addPartitions = TUtil.newList();
    +    CatalogProtos.PartitionDescProto existingPartition = null;
    +
    +    try {
    +      client = clientPool.getClient();
    +      for (CatalogProtos.PartitionDescProto partitionDescProto : 
partitions) {
    +        existingPartition = getPartition(databaseName, tableName, 
partitionDescProto.getPartitionName());
    +
    +        // Unfortunately, hive client add_partitions doesn't run as 
expected. The method never read the ifNotExists
    +        // parameter. So, if Tajo add existing partition to Hive, it will 
threw AlreadyExistsException. To avoid
    +        // above error, we need filter existing partitions before call 
add_partitions.
    --- End diff --
    
    ``need`` should be ``need to``.


> Create dynamic partitions to CatalogStore by running insert query or CTAS 
> query.
> --------------------------------------------------------------------------------
>
>                 Key: TAJO-1346
>                 URL: https://issues.apache.org/jira/browse/TAJO-1346
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: Physical Operator
>            Reporter: Jaehwa Jung
>            Assignee: Jaehwa Jung
>
> Currently, If new partitions are added to HDFS by ColPartitionStoreExec, 
> CatalogStore will not be aware of these partitions. So, Tajo need to load 
> newly added partitions automatically to CatalogStore by running insert query 
> or CTAS query.



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

Reply via email to