-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] [BE] Supporting partial pattern match #53
Comments
I meant the other one for multiple ORs into an IN predicate.
By partial, we mean if the input query has a tree with root R and three
children C1, C2, C3, and the pattern in the rule is a tree with root R and
two children C1 and C2, then the input query tree can partially match and
replace the C1 and C2 with a new child D1, but the original non-matching
child C3 won’t be affected. And the final result is the query tree becomes
root R and two children D1 and C3.
What you described is the reversed version.
…On Thu, Jan 16, 2025 at 14:33 Yihong Yu ***@***.***> wrote:
Partial matching refers to the ability to partially match a rule to an
input query, accepting a match from a subtree rather than requiring the
entire parsing tree. This approach gives greater flexibility, enabling more
rules in the knowledge base to apply to input queries that partially
conform to a rule pattern.
For example, consider a rule in the knowledge base:
# pattern:
SELECT DISTINCT <<x2>> FROM <<x1>> WHERE <<y1>>
# rewrite:
SELECT <<x2>> FROM <<x1>> WHERE <<y1>> GROUP BY <<x2>>
If we are given the input query:
SELECT DISTINCT <<x2>> FROM <<x1>>
Without partial matching, the above rule cannot apply since the input
query is missing a WHERE clause. However, with partial matching, we can
partially apply the rule and rewrite the query as:
SELECT <<x2>> FROM <<x1>> GROUP BY <<x2>>
This optimization aligns the query better with human understanding.
—
Reply to this email directly, view it on GitHub
<#53 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB542BWBG67NIHTR2FUCSIL2LAXU7AVCNFSM6AAAAABVKLUZDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJXGA2DGMBXGY>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
Got it! I'll edit my comment to align with this definition. |
@HazelYuAhiru , please copy the example query pair in your slide to describe what the partial pattern match means and how it can help to make our rules more general.
The text was updated successfully, but these errors were encountered: