[
https://issues.apache.org/jira/browse/TAJO-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14626525#comment-14626525
]
ASF GitHub Bot commented on TAJO-1345:
--------------------------------------
Github user jihoonson commented on the pull request:
https://github.com/apache/tajo/pull/618#issuecomment-121286848
It seems that there is another problem. That is, given a partitioned table,
```alter table add partition``` is executed in two ways.
Here is an example.
```
tpch> create table partitioned_nation (n_name text, n_comment text) using
text partition by column (n_regionkey int8, n_nationkey int8) as select n_name,
n_comment, n_regionkey, n_nationkey from nation;
tpch> \dfs -ls
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1
Found 5 items
drwxr-xr-x - jihoon supergroup 0 2015-07-15 00:22
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1/n_nationkey=1
drwxr-xr-x - jihoon supergroup 0 2015-07-15 00:22
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1/n_nationkey=17
drwxr-xr-x - jihoon supergroup 0 2015-07-15 00:22
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1/n_nationkey=2
drwxr-xr-x - jihoon supergroup 0 2015-07-15 00:22
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1/n_nationkey=24
drwxr-xr-x - jihoon supergroup 0 2015-07-15 00:22
/tajo/warehouse/warehouse/tpch/partitioned_nation/n_regionkey=1/n_nationkey=3
```
As you can see in the above, the partition of (n_regionkey=1,n_nationkey=2)
exists after creating the partition table.
When I run the following ```alter table add partition``` statement, it is
successfully executed. However, I think that this should be failed because
there already exists a partition for the same partition key.
```
tpch> alter table partitioned_nation add partition (n_regionkey=1,
n_nationkey=2) location
'hdfs://localhost:7020/tajo/warehouse/default/partitioned_nation/col1=test2/col2=3';
OK
```
In addition, when I run the following ```alter table add partition```
statement, it is failed as I expected above. But, the inconsistent execution of
```alter table add partition``` must be fixed.
```
tpch> alter table partitioned_nation add partition (n_regionkey=1,
n_nationkey=2) location
'hdfs://localhost:7020/tajo/warehouse/default/partitioned_nation/col1=test1/col2=2';
ERROR: partition "n_regionkey=1/n_nationkey=2 already exist in
"partitioned_nation"
```
> 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, TAJO-1345_2.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)