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

Partitioning pruning produces wrong results when there are nested expressions in the filter

Attach filesAttach ScreenshotVotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Consider the following query:
      select 1 from foo where dir0 not in (1994) and col1 not in ('bar');

      The filter condition is: AND(NOT(=($1, 1994)), NOT(=($2, 'bar')))
      In FindPartitionCondition we rewrite the filter to cherry pick the partition column conditions so the interpreter can evaluate it, however when the expression contains more than two levels of nesting (in this case AND(NOT(=))) ) the expression does not get rewritten correctly. In this case the expression gets rewritten as: AND(=($1, 1994)). NOT is missing from the rewritten expression producing wrong results.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mehant Mehant Baid
            mehant Mehant Baid
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment