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

    https://github.com/apache/tajo/pull/772#discussion_r39944228
  
    --- Diff: 
tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
 ---
    @@ -2228,6 +2244,257 @@ private void setPartitionKeys(int pid, 
PartitionDescProto.Builder partitionDesc)
         return partitions;
       }
     
    +  /**
    +   * Check if list of partitions exist on catalog.
    +   *
    +   *
    +   * @param databaseId
    +   * @param tableId
    +   * @return
    +   */
    +  public boolean existPartitionsOnCatalog(int tableId) {
    +    Connection conn = null;
    +    ResultSet res = null;
    +    PreparedStatement pstmt = null;
    +    boolean result = false;
    +
    +    try {
    +      String sql = "SELECT COUNT(*) CNT FROM "
    --- End diff --
    
    This is trivial, but you can perform a simple select rather than count 
aggregation which is more expensive operation.


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