Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/772#discussion_r40202591
--- Diff:
tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/rules/PartitionedTableRewriter.java
---
@@ -118,13 +120,76 @@ 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, UnsupportedException {
+ Path [] filteredPaths = null;
FileSystem fs = tablePath.getFileSystem(queryContext.getConf());
+ String [] splits = CatalogUtil.splitFQTableName(tableName);
+ List<PartitionDescProto> partitions = null;
+
+ try {
+ if (conjunctiveForms == null) {
+ partitions = catalog.getPartitionsOfTable(splits[0], splits[1]);
+ if (partitions.isEmpty()) {
+ filteredPaths =
findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs,
tablePath);
+ } else {
+ filteredPaths = findFilteredPathsByPartitionDesc(partitions);
+ }
+ } else {
+ if (catalog.existPartitions(splits[0], splits[1])) {
+ PartitionsByAlgebraProto request =
getPartitionsAlgebraProto(splits[0], splits[1], conjunctiveForms);
+ partitions = catalog.getPartitionsByAlgebra(request);
+ filteredPaths = findFilteredPathsByPartitionDesc(partitions);
+ } else {
+ filteredPaths =
findFilteredPathsFromFileSystem(partitionColumns, conjunctiveForms, fs,
tablePath);
+ }
+ }
+ } catch (UnsupportedException ue) {
--- End diff --
IMO, this case is regarded as the full scan on partitions.
So, the same routine with the above ```if (conjunctiveForms == null)```
clause is required here.
---
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.
---