Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
0d2a634
Implement PartitionedFileFragment
blrunner Oct 28, 2015
4d7e73b
Add unit test cases for PartitionedFileFragment
blrunner Oct 28, 2015
6fab5ad
Add PartitionedTableUtil for finding filtered partition directories.
blrunner Oct 29, 2015
b3bbcd1
Remove the array of partition directories of rerwrite rule and apply …
blrunner Nov 2, 2015
25163d0
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 2, 2015
4f711fa
Remove unnecessary method
blrunner Nov 2, 2015
33dc140
Update comments
blrunner Nov 2, 2015
dede3e2
Remove unnecessary constructor parameter of PhysicalPlannerImpl
blrunner Nov 2, 2015
ccc4f6c
Remove unnecessary parameter of PartitionedTableUtil::buildTupleFromP…
blrunner Nov 2, 2015
d5f563a
Update wrong indent
blrunner Nov 2, 2015
086b02b
Remove unused package
blrunner Nov 2, 2015
22731ec
Update wrong comparison operator
blrunner Nov 2, 2015
437f5ec
Update log message
blrunner Nov 2, 2015
d76f41a
When rewriting PartitionedTableScanNode, set partition paths and tabl…
blrunner Nov 3, 2015
126f5e0
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 3, 2015
9112ceb
Update the result message of partition pruning
blrunner Nov 3, 2015
71d65a5
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 5, 2015
c53dfab
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 6, 2015
a3af9ad
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 10, 2015
548bd42
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 19, 2015
66c1c49
Remove unused member variable.
blrunner Nov 20, 2015
25e2366
Remove unused method
blrunner Nov 20, 2015
c7f89f7
Separate partition processing logic from existing split method.
blrunner Nov 20, 2015
e670f25
Rename partitionName to partitionKeys in PartitionedFileFragmentProto
blrunner Nov 20, 2015
83065d6
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 21, 2015
c21d065
Rename PartitionedFileFragment to PartitionFileFragment
blrunner Nov 21, 2015
9d92e54
Recover partition paths in LogicalNode
blrunner Nov 21, 2015
f9fcd27
Add PartitionedTableWriter::buildTupleFromPartitionName
blrunner Nov 21, 2015
344384b
PartitionedTableRewriter should set PartitionContent
blrunner Nov 23, 2015
b327993
Remove unused packages
blrunner Nov 23, 2015
22d3ad7
Remove unused package
blrunner Nov 23, 2015
9009b2a
Remove unused class
blrunner Nov 23, 2015
92063a0
Implement FileTableSpace::makeNonPartitionSplit
blrunner Nov 23, 2015
fc6043f
Update the line of added methods in FileTablespace
blrunner Nov 23, 2015
3fe18c9
Implement FileTableSpace::partitionSplit
blrunner Nov 23, 2015
fc16d15
Added simple description for splitting partitioned table
blrunner Nov 23, 2015
7e35b06
Fix bugs
blrunner Nov 23, 2015
e371275
Rename fileFragments to partitionFileFragments
blrunner Nov 23, 2015
fdeeb79
Remove codes for checking the NULL of partition keys
blrunner Nov 23, 2015
0e7ce93
Rename keys to partitionKeys in PlanProto
blrunner Nov 23, 2015
80a872c
Update description
blrunner Nov 23, 2015
8e11cbc
Remove unnecessary updates
blrunner Nov 23, 2015
7596c3c
Remove unncessary method
blrunner Nov 23, 2015
56ec31a
Remove unused packages
blrunner Nov 23, 2015
1735d67
Update PartitionedTableRewriter::getPartitionContentByFileSystem
blrunner Nov 23, 2015
e062a72
Remove unused constructor
blrunner Nov 24, 2015
390ee45
Transmit ScanNode instead of PartitionedTableScanNode
blrunner Nov 24, 2015
f24577a
Remove unused package
blrunner Nov 24, 2015
c4c4d36
Remove unnnecessary codes
blrunner Nov 24, 2015
b428f24
Remove unnecessary modification
blrunner Nov 24, 2015
772c049
Implement unit test cases for PartitionedTableRewriter
blrunner Nov 25, 2015
3939b68
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 25, 2015
3f5f238
Trigger for travis CI build
blrunner Nov 25, 2015
915c5c6
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Nov 26, 2015
586030b
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 2, 2015
eed923b
Remove unused methods
blrunner Dec 2, 2015
224dfc2
Remove previous split size
blrunner Dec 3, 2015
e390fc6
Mark final keword to all member variables in PartitionFragement
blrunner Dec 3, 2015
707866a
Add more description
blrunner Dec 3, 2015
dc67e05
Apply lamda expression
blrunner Dec 3, 2015
8e5f257
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 3, 2015
8a52561
Implement methods for PartitionFileFragment to S3TableSpace
blrunner Dec 3, 2015
52b3790
Revert "Implement methods for PartitionFileFragment to S3TableSpace"
blrunner Dec 3, 2015
c1e6fff
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Dec 3, 2015
d8f1186
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 3, 2015
4580f53
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 7, 2015
69e6c61
Add dist id to PartitionFileFragment
blrunner Dec 7, 2015
28edf6c
PartitionFileFragment extends FileFragment
blrunner Dec 7, 2015
8446fc3
Trigger for tavis ci build
blrunner Dec 7, 2015
c8f041e
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 7, 2015
9407a88
Trigger for Travis CI build
blrunner Dec 7, 2015
8c05203
Add debug logs
blrunner Dec 9, 2015
909a601
Fix unit test bug
blrunner Dec 9, 2015
4ab2b51
Remove comments
blrunner Dec 10, 2015
c2a5aae
Remove debug logs
blrunner Dec 10, 2015
14374cd
Rename buildTupleFromPartitionName to buildTupleFromPartitionKeys
blrunner Dec 10, 2015
26cab49
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 10, 2015
e015415
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 11, 2015
d233218
Add messages for printing elapsed time.
blrunner Dec 15, 2015
135f530
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 15, 2015
1790fb0
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Dec 30, 2015
490cb1a
Trigger for travis CI build
blrunner Jan 5, 2016
ec10d1c
Trigger for Travis CI build
blrunner Jan 7, 2016
633edc1
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Jan 7, 2016
a96c653
Trigger CI build
blrunner Jan 7, 2016
f7c5149
Remove TUtil::newList
blrunner Jan 8, 2016
520c57b
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Jan 13, 2016
2099ad9
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 1, 2016
da00b48
Rename PartitionContent to PartitionPruningHandle
blrunner Feb 2, 2016
3cce3f4
Rename method names
blrunner Feb 2, 2016
48a14c0
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 11, 2016
ee414e9
Trigger for Travis CI build
blrunner Feb 11, 2016
2f9140c
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 16, 2016
913d162
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 17, 2016
76c8b38
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 17, 2016
06d7458
Trigger travis CI build
blrunner Feb 18, 2016
df30b17
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 19, 2016
635fd75
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Feb 22, 2016
e82ebef
Trigger for travis CI build
blrunner Feb 22, 2016
37e1602
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 7, 2016
1d0f5e2
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 18, 2016
deaacad
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 18, 2016
7790f3e
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 18, 2016
1bba8db
Enable alter table add partition statement
blrunner Mar 18, 2016
a7ba6fc
Add unit test cases for arbitrary partition path
blrunner Mar 18, 2016
f9017d0
Add unit test cases to TajoDump
blrunner Mar 18, 2016
c9f72df
Fix bugs in TestCatalogExceptions
blrunner Mar 18, 2016
22da7fb
Add descriptions to document.
blrunner Mar 18, 2016
36616d0
PartitionedTableRewriter just rewrite ScanNode to PartitionedTableSca…
blrunner Mar 21, 2016
3370a10
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 21, 2016
8f3e728
Remove unnecessary codes
blrunner Mar 21, 2016
77327bf
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 21, 2016
af9d863
Fix wrong parameter
blrunner Mar 22, 2016
e256a79
Fix bugs in TestMultipleJoinTypes::testInnerAndOuterWithEmpty
blrunner Mar 22, 2016
0dda401
Remove some codes because of code conflick
blrunner Mar 22, 2016
7d4bbed
Fix bugs in TestMultipleJoinTypes::testInnerAndOuterWithEmpty
blrunner Mar 22, 2016
5d59464
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 22, 2016
8036ed3
Show informs of PartitionFileFragment on web UI
blrunner Mar 22, 2016
523accf
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 22, 2016
dee12c2
Fix unit test bugs for TajoCli
blrunner Mar 22, 2016
b335fde
Remove informs of PartitionFileFragment on web UI
blrunner Mar 23, 2016
6d38553
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 23, 2016
dd00174
Move isPartitionSplittable to right position
blrunner Mar 23, 2016
a4c53ee
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 23, 2016
d3367d0
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 23, 2016
dd095f0
Add antlr-runtime to dependency for unit tests
blrunner Mar 23, 2016
fcd30e4
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 28, 2016
5b43e9e
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 28, 2016
9dc07f6
Fix a build bug
blrunner Mar 28, 2016
22dc270
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 28, 2016
b147aee
Fix a compile bug
blrunner Mar 28, 2016
47ecc70
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Mar 30, 2016
5a03078
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Mar 30, 2016
84c62fb
Refactor methods for splitting partition fragment
blrunner Apr 4, 2016
7e8ba5f
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 4, 2016
9cb19a9
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Apr 4, 2016
2b9ddce
Remove unnecessary modifications
blrunner Apr 5, 2016
657012c
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 19, 2016
4567246
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 19, 2016
dd6e955
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 21, 2016
5934bbe
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 21, 2016
a5f8bac
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner Apr 21, 2016
65716f8
Fix a compile bug for an unit test.
blrunner Apr 21, 2016
299fbe9
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 22, 2016
086341c
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 22, 2016
b9149c8
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 25, 2016
bfe3c07
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 28, 2016
f3dca71
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 28, 2016
6640ae2
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 29, 2016
c7d598d
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner Apr 29, 2016
9f21bc5
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner May 8, 2016
bd54c99
Fix a bug of unit tests
blrunner May 8, 2016
03068a7
Merge branch 'TAJO-1891' of https://github.com/blrunner/tajo into TAJ…
blrunner May 8, 2016
8462c51
Remove QueryTestCaseBase from TestPartitionedTableRewriter
blrunner May 9, 2016
2666559
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner May 12, 2016
dc0d6c2
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 12, 2016
a440b5c
Add order by clause to AbstractDBStore::getPartitionsOfTable
blrunner May 12, 2016
983707b
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 12, 2016
da755d9
Fix unit test bugs
blrunner May 13, 2016
555eaec
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 13, 2016
15f97fd
Remove codes for Stream::anyMatch
blrunner May 13, 2016
e41e8c1
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 13, 2016
fd8f144
Remove unused package
blrunner May 13, 2016
23334f7
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 13, 2016
df246db
Fix an unit test bug
blrunner May 13, 2016
8a9837c
Clean up test codes
blrunner May 13, 2016
e00d2a1
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 13, 2016
6c70e3d
Clean up test codes
blrunner May 13, 2016
e966984
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo…
blrunner May 13, 2016
4878238
Merge branch 'TAJO-1952' of https://github.com/blrunner/tajo into TAJ…
blrunner May 13, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public static TableDesc newTableDesc(String tableName, Schema schema, TableMeta
return new TableDesc(tableName, schema, meta, path.toUri());
}

public static TableDesc newTableDesc(String tableName, Schema schema, TableMeta meta, Path path
, PartitionMethodDesc partitionMethodDesc) {
return new TableDesc(tableName, schema, meta, path.toUri(), partitionMethodDesc);
}

public static TableDesc newTableDesc(TableDescProto proto) {
return new TableDesc(proto);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,46 @@ public class TableDesc implements ProtoObject<TableDescProto>, GsonObject, Clone
public TableDesc() {
}

public TableDesc(String tableName, @Nullable Schema schema, TableMeta meta, @Nullable URI uri, boolean external) {
this(tableName, schema, meta, uri, null, external);
}

public TableDesc(String tableName, @Nullable Schema schema, TableMeta meta,
@Nullable URI uri, boolean external) {
@Nullable URI uri, @Nullable PartitionMethodDesc partitionMethodDesc, boolean external) {
this.tableName = tableName;
this.schema = schema;
this.meta = meta;
this.uri = uri;
this.partitionMethodDesc = partitionMethodDesc;
this.external = external;
}

public TableDesc(String tableName, @Nullable Schema schema, TableMeta meta, @Nullable URI path) {
this(tableName, schema, meta, path, true);
this(tableName, schema, meta, path, null, true);
}


public TableDesc(String tableName, @Nullable Schema schema, TableMeta meta, @Nullable URI path,
@Nullable PartitionMethodDesc partitionMethodDesc) {
this(tableName, schema, meta, path, partitionMethodDesc, true);
}

public TableDesc(String tableName, @Nullable Schema schema, String dataFormat, KeyValueSet options,
@Nullable URI path) {
this(tableName, schema, new TableMeta(dataFormat, options), path);
}

public TableDesc(TableDescProto proto) {

public TableDesc(String tableName, @Nullable Schema schema, String dataFormat, KeyValueSet options,
@Nullable URI path, @Nullable PartitionMethodDesc partitionMethodDesc) {
this(tableName, schema, new TableMeta(dataFormat, options), path, partitionMethodDesc);
}

public TableDesc(TableDescProto proto) {
this(proto.getTableName(), proto.hasSchema() ? SchemaFactory.newV1(proto.getSchema()) : null,
new TableMeta(proto.getMeta()), proto.hasPath() ? URI.create(proto.getPath()) : null, proto.getIsExternal());
new TableMeta(proto.getMeta()), proto.hasPath() ? URI.create(proto.getPath()) : null,
proto.hasPartition() ? new PartitionMethodDesc(proto.getPartition()) : null,
proto.getIsExternal());
if(proto.hasStats()) {
this.stats = new TableStats(proto.getStats());
}
if (proto.hasPartition()) {
this.partitionMethodDesc = new PartitionMethodDesc(proto.getPartition());
}
}

Expand Down
9 changes: 8 additions & 1 deletion tajo-catalog/tajo-catalog-drivers/tajo-hive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<hive.antlr.version>3.4</hive.antlr.version>
</properties>

<build>
Expand Down Expand Up @@ -163,7 +164,7 @@
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-metastore</artifactId>
<version>${hive.version}</version>
<version>${hive.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -369,6 +370,12 @@
<artifactId>parquet-hadoop-bundle</artifactId>
<version>${parquet.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
<version>${hive.antlr.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void testTableWithNullValue() throws Exception {

}

// TODO: This should be added at TAJO-1891
@Test
public void testAddTableByPartition() throws Exception {
TableMeta meta = new TableMeta("TEXT", new KeyValueSet());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,6 @@ public ReturnState alterTable(RpcController controller, AlterTableDescProto prot
return errInsufficientPrivilege("alter a table in database '" + split[0] + "'");
}

// TODO: This should be removed at TAJO-1891
if (proto.getAlterTableType() == CatalogProtos.AlterTableType.ADD_PARTITION) {
return errFeatureNotImplemented("ADD PARTTIION");
}

wlock.lock();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public final void testAddAndDeleteTablePartitionByRange() throws Exception {
assertFalse(catalog.existsTable(tableName));
}

// TODO: This should be added at TAJO-1891
@Test
public final void testAddAndDeleteTablePartitionByColumn() throws Exception {
Schema schema = SchemaBuilder.builder()
.add("id", Type.INT4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void testTable() throws Exception {
}
}

// TODO: This should be added at TAJO-1891
@Test
public void testTablePartition() throws Exception {
//////////////////////////////////////////////////////////////////////////////
// Test add partition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void testUpdateTableStatsOfUndefinedTable() throws Exception {
build());
}

// TODO: This should be added at TAJO-1891
@Test
public void testAddPartitionWithWrongUri() throws Exception {
// TODO: currently, wrong uri does not occur any exception.
String partitionName = "DaTe=/=AaA";
Expand All @@ -173,7 +173,7 @@ public void testAddPartitionWithWrongUri() throws Exception {
catalog.alterTable(alterTableDesc);
}

// TODO: This should be added at TAJO-1891
@Test(expected = DuplicatePartitionException.class)
public void testAddDuplicatePartition() throws Exception {
String partitionName = "DaTe=bBb/dAtE=AaA";
PartitionDesc partitionDesc = CatalogTestingUtil.buildPartitionDesc(partitionName);
Expand All @@ -196,7 +196,7 @@ public void testAddDuplicatePartition() throws Exception {
catalog.alterTable(alterTableDesc);
}

// TODO: This should be added at TAJO-1891
@Test(expected = UndefinedTableException.class)
public void testAddPartitionToUndefinedTable() throws Exception {
String partitionName = "DaTe=bBb/dAtE=AaA";
PartitionDesc partitionDesc = CatalogTestingUtil.buildPartitionDesc(partitionName);
Expand All @@ -209,19 +209,6 @@ public void testAddPartitionToUndefinedTable() throws Exception {
catalog.alterTable(alterTableDesc);
}

// TODO: This should be removed at TAJO-1891
@Test(expected = NotImplementedException.class)
public void testAddPartitionNotimplementedException() throws Exception {
String partitionName = "DaTe=/=AaA";
PartitionDesc partitionDesc = CatalogTestingUtil.buildPartitionDesc(partitionName);

AlterTableDesc alterTableDesc = new AlterTableDesc();
alterTableDesc.setTableName(IdentifierUtil.buildFQName("TestDatabase1", "TestPartition1"));
alterTableDesc.setPartitionDesc(partitionDesc);
alterTableDesc.setAlterTableType(AlterTableType.ADD_PARTITION);

catalog.alterTable(alterTableDesc);
}

@Test(expected = UndefinedPartitionException.class)
public void testDropUndefinedPartition() throws Exception {
Expand Down
12 changes: 4 additions & 8 deletions tajo-cli/src/main/java/org/apache/tajo/cli/tools/TajoDump.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,10 @@ private static void dumpDatabase(TajoClient client, String databaseName, PrintWr
writer.write("--\n");
writer.write(String.format("-- Table Partitions: %s%n", tableName));
writer.write("--\n");
// TODO: This should be improved at TAJO-1891
// List<PartitionDescProto> partitionProtos = client.getPartitionsOfTable(fqName);
// for (PartitionDescProto eachPartitionProto : partitionProtos) {
// writer.write(DDLBuilder.buildDDLForAddPartition(table, eachPartitionProto));
// }
writer.write(String.format("ALTER TABLE %s REPAIR PARTITION;",
IdentifierUtil.denormalizeIdentifier(databaseName) + "." + IdentifierUtil.denormalizeIdentifier(tableName)));

List<CatalogProtos.PartitionDescProto> partitionProtos = client.getPartitionsOfTable(fqName);
for (CatalogProtos.PartitionDescProto eachPartitionProto : partitionProtos) {
writer.write(DDLBuilder.buildDDLForAddPartition(table, eachPartitionProto));
}
writer.write("\n\n");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,17 @@ public void testPartitionsDump() throws Exception {
+ " partition by column(\"col3\" int4, \"col4\" int4)"
);

// TODO: This should be improved at TAJO-1891
// executeString("ALTER TABLE \"" + getCurrentDatabase() + "\".\"TableName3\"" +
// " ADD PARTITION (\"col3\" = 1 , \"col4\" = 2)");
// executeString("ALTER TABLE \"" + getCurrentDatabase() + "\".\"TableName4\"" +
// " ADD PARTITION (\"col3\" = 'tajo' , \"col4\" = '2015-09-01')");
executeString("ALTER TABLE \"" + getCurrentDatabase() + "\".\"TableName3\"" +
" ADD PARTITION (\"col3\" = 1 , \"col4\" = 2)");

executeString("create table \"" + getCurrentDatabase() + "\".\"TableName4\""
+ " (\"col1\" int4, \"col2\" int4) "
+ " partition by column(\"col3\" TEXT, \"col4\" date)"
);

executeString("ALTER TABLE \"" + getCurrentDatabase() + "\".\"TableName4\"" +
" ADD PARTITION (\"col3\" = 'tajo' , \"col4\" = '2015-09-01')");

try {
UserRoleInfo userInfo = UserRoleInfo.getCurrentUser();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,19 +547,7 @@ public void testResultRowNumWhenSelectingOnPartitionedTable() throws Exception {
}
}

// TODO: This should be removed at TAJO-1891
@Test
public void testAddPartitionNotimplementedException() throws Exception {
String tableName = IdentifierUtil.normalizeIdentifier("testAddPartitionNotimplementedException");
tajoCli.executeScript("create table " + tableName + " (col1 int4, col2 int4) partition by column(key float8)");
tajoCli.executeScript("alter table " + tableName + " add partition (key2 = 0.1)");

String consoleResult;
consoleResult = new String(out.toByteArray());
assertOutputResult(consoleResult);
}

// TODO: This should be added at TAJO-1891
public void testAlterTableAddDropPartition() throws Exception {
String tableName = IdentifierUtil.normalizeIdentifier("testAlterTableAddPartition");

Expand All @@ -586,8 +574,10 @@ public void testAlterTableAddDropPartition() throws Exception {

tajoCli.executeScript("alter table " + tableName + " drop partition (col3 = 0.1, col4 = 10)");

String consoleResult = new String(out.toByteArray());
assertOutputResult(consoleResult);
String stdoutResult = new String(out.toByteArray());
assertOutputResult(stdoutResult);
String stdErrResult = new String(err.toByteArray());
assertErrorResult(stdErrResult, false);
}

public static class TajoCliOutputTestFormatter extends DefaultTajoCliOutputFormatter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ public final void testAlterTableRepairPartiton() throws TajoException {
"ALTER TABLE partitioned_table DROP PARTITION (col1 = '2015' , col2 = '01', col3 = '11' )", //1
};

// TODO: This should be added at TAJO-1891
@Test
public final void testAddPartitionAndDropPartition() throws TajoException {
String tableName = IdentifierUtil.normalizeIdentifier("partitioned_table");
String qualifiedTableName = IdentifierUtil.buildFQName(DEFAULT_DATABASE_NAME, tableName);
Expand Down
Loading