Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-8400

Fix pruning partitions with pushed transitive predicates

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.20.3
    • 1.21.0
    • None
    • None

    Description

      See TestHivePartitionPruning.prunePartitionsBasedOnTransitivePredicates() test for details.

      The issue occurs for queries like these:

      SELECT * FROM hive.partition_pruning_test t1 
      JOIN hive.partition_with_few_schemas t2 ON t1.`d` = t2.`d` AND t1.`e` = t2.`e` 
      WHERE t2.`e` IS NOT NULL AND t1.`d` = 1
      

      The expected behavior is to create additional filters based on the existing filters and join conditions. We have a TRANSITIVE_CLOSURE planning phase, which is responsible for such query transformations, but Drill pushes down filters from the WHERE condition before that phase, so the optimization is not performed.

      Ideally, we should move rules from the TRANSITIVE_CLOSURE phase to the LOGICAL phase so that the planner will choose the most optimal plan, but it wouldn't help until CALCITE-1048 is fixed (it is required to pull predicates when three has RelSubset nodes).

      Attachments

        Activity

          People

            volodymyr Vova Vysotskyi
            volodymyr Vova Vysotskyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: