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

    https://github.com/apache/tajo/pull/618#discussion_r33783109
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java ---
    @@ -446,11 +447,35 @@ public void alterTable(TajoMaster.MasterContext 
context, final QueryContext quer
         case SET_PROPERTY:
           catalog.alterTable(CatalogUtil.setProperty(qualifiedName, 
alterTable.getProperties(), AlterTableType.SET_PROPERTY));
           break;
    +    case ADD_PARTITION:
    +      existColumnNames(qualifiedName, alterTable.getColumnNames());
    +      
catalog.alterTable(CatalogUtil.addPartitionAndDropPartition(qualifiedName, 
alterTable.getColumnNames(),
    +        alterTable.getPartitionValues(), alterTable.getLocation(), 
AlterTableType.ADD_PARTITION));
    +      break;
    +    case DROP_PARTITION:
    +      existColumnNames(qualifiedName, alterTable.getColumnNames());
    +      
catalog.alterTable(CatalogUtil.addPartitionAndDropPartition(qualifiedName, 
alterTable.getColumnNames(),
    +        alterTable.getPartitionValues(), alterTable.getLocation(), 
AlterTableType.DROP_PARTITION));
    +      break;
         default:
           //TODO
         }
       }
     
    +  private boolean existColumnNames(String tableName, String[] columnNames) 
{
    +    for(String columnName : columnNames) {
    +      if (!existPartitionColumnName(tableName, columnName)) {
    +        throw new NoSuchColumnException(columnName);
    --- End diff --
    
    This case seems to indicate that the given table has a given column, but 
not as a partition key. If so, ```NoSuchColumnException``` makes users confused.
    How about make a new exception for it such as 
```NoSuchPartitionKeyException```?


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