[
https://issues.apache.org/jira/browse/TAJO-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14612014#comment-14612014
]
ASF GitHub Bot commented on TAJO-1345:
--------------------------------------
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```?
> Implement logical plan part and DDL executor for alter partition.
> -----------------------------------------------------------------
>
> Key: TAJO-1345
> URL: https://issues.apache.org/jira/browse/TAJO-1345
> Project: Tajo
> Issue Type: Sub-task
> Components: planner/optimizer
> Reporter: Jaehwa Jung
> Assignee: Jaehwa Jung
> Fix For: 0.11.0
>
> Attachments: TAJO-1345.patch
>
>
> See the title. The main objective of this issue is to implement the logical
> planning part and the DDL executor part for alter table partition support.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)