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"
```
---
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.
---