-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partial indexing support for skipping index #124
Closed
dai-chen
wants to merge
17
commits into
opensearch-project:main
from
dai-chen:add-where-clause-for-skipping-index
Closed
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7b39800
Add filter condition in Flint API layer and fix IT
dai-chen 7bafbc7
Add ast builder and SQL IT
dai-chen ea8b2a7
Remove unused parser IT
dai-chen bc50661
Fix scalafmt
dai-chen cf4034a
Add conjunction check for skipping and covering index
dai-chen 217537f
Merge branch 'main' into add-where-clause-for-skipping-index
dai-chen 87f53b2
Enforce hybrid scan if skipping index is partial
dai-chen 194f1ae
Add IT for partial index query rewrite
dai-chen c65671e
Add UT for partial skipping index
dai-chen 7733b61
Merge branch 'main' into add-where-clause-for-skipping-index
dai-chen e61f3dd
Fix hybrid scan bug
dai-chen 98972e2
Add more logging
dai-chen 201cb09
Restrict column has to be partitioned column
dai-chen a7c2164
Update user manual
dai-chen e61d051
Merge branch 'opensearch-project:main' into add-where-clause-for-skip…
dai-chen 422c46d
Fix broken IT
dai-chen ebf6848
Merge branch 'main' into add-where-clause-for-skipping-index
dai-chen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
flint-spark-integration/src/main/scala/org/opensearch/flint/spark/FlintSparkIndexUtils.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.flint.spark | ||
|
||
import org.apache.spark.sql.catalyst.expressions.{Expression, Or} | ||
import org.apache.spark.sql.functions.expr | ||
|
||
/** | ||
* Flint Spark index utility methods. | ||
*/ | ||
object FlintSparkIndexUtils { | ||
|
||
/** | ||
* Is the given Spark predicate string a conjunction | ||
* | ||
* @param condition | ||
* predicate condition string | ||
* @return | ||
* true if yes, otherwise false | ||
*/ | ||
def isConjunction(condition: String): Boolean = { | ||
isConjunction(expr(condition).expr) | ||
} | ||
|
||
/** | ||
* Is the given Spark predicate a conjunction | ||
* | ||
* @param condition | ||
* predicate condition | ||
* @return | ||
* true if yes, otherwise false | ||
*/ | ||
def isConjunction(condition: Expression): Boolean = { | ||
condition.collectFirst { case Or(_, _) => | ||
true | ||
}.isEmpty | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on current understanding, Anti Semi join seems required. Even if we support push down optimization for array, the
OR
condition in previous Left Outer join cannot be pushed down to skipping index.