Skip to content

Conversation

@wecharyu
Copy link
Contributor

What changes were proposed in this pull request?

  1. Convert adjacent AND LeafNodes to a MultiAndLeafNode
  2. Concatenate partition name filter in MultiAndLeafNode

Why are the changes needed?

Match longer index prefix in partition filter to improve performance.

For example, a table has partition key: a, b, c, d, and a filter is a=1 and b=1 and c=1, when visit as a binary tree AND(AND(a=1, b=1), c=1), the filter is:

PART_NAME like 'a=1/%' and PART_NAME like '%/b=2/%' and PART_NAME like '%/c=3/%'

If we combine the adjacent AND conditions, the tree will be MultiAnd(a=1, b=2, c=3), and the filte can be:

PART_NAME like 'a=1/b=2/c=3/%'

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Add unit tests.

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants