Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/624#discussion_r39012228
--- Diff:
tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
---
@@ -118,32 +121,264 @@ public String toString() {
* @return
* @throws IOException
*/
- private Path [] findFilteredPaths(OverridableConf queryContext, Schema
partitionColumns, EvalNode [] conjunctiveForms,
- Path tablePath)
- throws IOException {
+ private Path [] findFilteredPaths(OverridableConf queryContext, String
tableName,
+ Schema partitionColumns, EvalNode []
conjunctiveForms, Path tablePath)
+ throws IOException, UndefinedDatabaseException,
UndefinedTableException,
+ UndefinedPartitionMethodException, UndefinedOperatorException {
+ Path [] filteredPaths = null;
FileSystem fs = tablePath.getFileSystem(queryContext.getConf());
+ String [] splits = CatalogUtil.splitFQTableName(tableName);
+ List<PartitionDescProto> partitions = null;
- PathFilter [] filters;
- if (conjunctiveForms == null) {
- filters = buildAllAcceptingPathFilters(partitionColumns);
- } else {
- filters = buildPathFiltersForAllLevels(partitionColumns,
conjunctiveForms);
+ String store =
queryContext.getConf().get(CatalogConstants.STORE_CLASS);
+
+ try {
+ // HiveCatalogStore provides list of table partitions with where
clause because hive just provides api using
+ // the filter string. So, this rewriter need to differentiate
HiveCatalogStore and other catalogs.
+ if (store.equals("org.apache.tajo.catalog.store.HiveCatalogStore")) {
--- End diff --
A RewriteRule should not consider its catalog storage type. It does not
make sense. CatalogService should just take an algebra, and HiveCatalogStore
should generates a filter expression string representation from the algebra.
---
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.
---