Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

[WIP] Add join v2 rule #501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sezruby
Copy link
Collaborator

@sezruby sezruby commented Oct 12, 2021

What is the context for this pull request?

What changes were proposed in this pull request?

Add a new rule for join query.

Currently, Hyperspace applies indexes only if there are available indexes for both left and right plan. (and their indexed columns should be the same).
However, applying one index can also be beneficial when it can remove the shuffle for one of left and right child.

I created a separate rule instead of merging the existing JoinIndexRule, because

  1. reduce possible side effect/regression from join rule v2
  2. for better extension - conditions / restrictions for v2 rule

The rule is disabled by default and can enable by a spark config:

spark.hyperspace.index.joinv2.enabled = true

Does this PR introduce any user-facing change?

Yes

How was this patch tested?

Unit test

TODO:

  • Hybrid scan test - follow-up PR
  • enhance PR description
  • documentation

import com.microsoft.hyperspace.index.sources.FileBasedRelation
import com.microsoft.hyperspace.util.ResolverUtils.resolve

trait JoinQueryPlanIndexFilter extends QueryPlanIndexFilter {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All functions are copied from JoinIndexRule (private -> protected)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant