Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/772#discussion_r39944289
--- Diff:
tajo-catalog/tajo-catalog-drivers/tajo-hive/src/main/java/org/apache/tajo/catalog/store/HiveCatalogStore.java
---
@@ -845,11 +856,155 @@ public boolean existPartitionMethod(String
databaseName, String tableName) throw
}
@Override
- public List<CatalogProtos.PartitionDescProto> getPartitions(String
databaseName,
- String tableName)
{
- throw new UnsupportedOperationException();
+ public List<CatalogProtos.PartitionDescProto> getAllPartitions(String
databaseName, String tableName)
+ throws UndefinedDatabaseException, UndefinedTableException,
UndefinedPartitionMethodException,
+ PartitionNotFoundException {
+ PartitionsByFilterProto.Builder request =
PartitionsByFilterProto.newBuilder();
+ request.setDatabaseName(databaseName);
+ request.setTableName(tableName);
+ request.setFilter("");
+
+ List<PartitionDescProto> partitions =
getPartitionsByFilter(request.build());
+ if (partitions.size() == 0) {
+ throw new PartitionNotFoundException(tableName);
+ } else {
+ return partitions;
+ }
+ }
+
+ @Override
+ public List<PartitionDescProto>
getPartitionsByAlgebra(PartitionsByAlgebraProto request) throws
+ UndefinedDatabaseException, UndefinedTableException,
UndefinedPartitionMethodException,
+ PartitionNotFoundException, UnsupportedException {
+
+ List<PartitionDescProto> list = null;
+
+ try {
+ String databaseName = request.getDatabaseName();
+ String tableName = request.getTableName();
+
+ TableDescProto tableDesc = getTable(databaseName, tableName);
+ String filter = getFilter(databaseName, tableName,
tableDesc.getPartition().getExpressionSchema().getFieldsList()
+ , request.getAlgebra());
+ list = getPartitionsByFilterFromHiveMetaStore(databaseName,
tableName, filter);
+ } catch (UnsupportedException ue) {
--- End diff --
I found it.
---
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.
---