Skip to content

Support for != predicate in pruning predicates #420

Closed

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

While evaluating queries against data stored in containers / multiple files, it is helpful to prune entire files using statistics (see #363 for more details). DataFusion has this logic already for ==, <, <=, > and >= operators in the pruning predicate.

However, as @NGA-TRAN noticed, there is no support for != at the moment.

https://github.com/apache/arrow-datafusion/blob/14f1eebef068a9e65f556ed74d2b6d98376c97f4/datafusion/src/physical_plan/parquet.rs#L683

Describe the solution you'd like
Add support and tests for != in predicate pruning logic

Activity

  1. added a commit that references this issue on Jun 10, 2021
  2. jgoday commented on Jun 10, 2021

    @jgoday
    Contributor

    @alamb Can I try to solve this issue ?

    If I understand it correctly, for the non equal predicate the expression should be pruned if the literal value does not fall between the min and max values, Am I right ?
    (I have already tried to implement it here (jgoday@3bb55a4), I can make a PR if you approve it)

  3. alamb commented on Jun 10, 2021

    @alamb
    ContributorAuthor

    Thanks @jgoday ! That would be great

    For != I think we would prune the container (aka return false or NULL) from the predicate if the constant value did fall within the min/max bounds but I might be misunderstanding what you are saying; I'll love to check out the PR

  4. jgoday commented on Jun 11, 2021

    @jgoday
    Contributor

    @alamb I think that I express myself incorrectly :)
    Created #544 PR.

  5. added 2 commits that reference this issue on Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions