-
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
Fix: test_generate_general_rule_16 #48
Conversation
@@ -2162,7 +2162,7 @@ def test_generate_general_rule_16(): | |||
|
|||
q0_rule, q1_rule = unify_variable_names(rule['pattern'], rule['rewrite']) | |||
assert q0_rule== "SELECT <x1>, <x2>, <x3>, <x4>, <x5>, <x6> FROM <x7> WHERE <x2> IN (SELECT <x2> FROM <x7> WHERE <x6> = <x8> AND <x3> = <x9>) ORDER BY <x2>, <x3>" | |||
assert q1_rule == "SELECT <x10>.<x1>, <x10>.<x2>, <x10>.<x3>, <x10>.<x4>, <x10>.<x5>, <x10>.<x6> FROM <x10> JOIN <x11> ON <x11>.<x2> = <x10>.<x2> WHERE <x11>.<x6> = <x8> AND <x11>.<x3> = <x9> ORDER BY <x10>.<x2>, <x10>.<x3>" | |||
assert q1_rule == "SELECT <x7>.<x1>, <x7>.<x2>, <x7>.<x3>, <x7>.<x4>, <x7>.<x5>, <x7>.<x6> FROM <x7> JOIN <x10> ON <x10>.<x2> = <x7>.<x2> WHERE <x10>.<x6> = <x8> AND <x10>.<x3> = <x9> ORDER BY <x7>.<x2>, <x7>.<x3>" |
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.
Why do we still have <x10>
?
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.
In the example query, we have FROM historicoestatusrequisicion hist1 JOIN historicoestatusrequisicion hist2
. In our current logic, hist2
will be represented as <x10>
to indicate that a JOIN is being performed on another table (even though hist1
and hist2
are the same table). As we discussed in July, it's still difficult for QueryBooster to determine if two tables with different alias are the same without refactoring the code. This is only a temporary fix before refactoring the code and the user still needs to manually replace <x10>
to make the rule meaningful in a pairwise comparison 😢
Let’s discuss this Friday.
…On Wed, Sep 25, 2024 at 15:44 Yihong Yu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/test_rule_generator.py
<#48 (comment)>:
> @@ -2162,7 +2162,7 @@ def test_generate_general_rule_16():
q0_rule, q1_rule = unify_variable_names(rule['pattern'], rule['rewrite'])
assert q0_rule== "SELECT <x1>, <x2>, <x3>, <x4>, <x5>, <x6> FROM <x7> WHERE <x2> IN (SELECT <x2> FROM <x7> WHERE <x6> = <x8> AND <x3> = <x9>) ORDER BY <x2>, <x3>"
- assert q1_rule == "SELECT <x10>.<x1>, <x10>.<x2>, <x10>.<x3>, <x10>.<x4>, <x10>.<x5>, <x10>.<x6> FROM <x10> JOIN <x11> ON <x11>.<x2> = <x10>.<x2> WHERE <x11>.<x6> = <x8> AND <x11>.<x3> = <x9> ORDER BY <x10>.<x2>, <x10>.<x3>"
+ assert q1_rule == "SELECT <x7>.<x1>, <x7>.<x2>, <x7>.<x3>, <x7>.<x4>, <x7>.<x5>, <x7>.<x6> FROM <x7> JOIN <x10> ON <x10>.<x2> = <x7>.<x2> WHERE <x10>.<x6> = <x8> AND <x10>.<x3> = <x9> ORDER BY <x7>.<x2>, <x7>.<x3>"
In the example query, we have FROM historicoestatusrequisicion hist1 JOIN
historicoestatusrequisicion hist2. In our current logic, hist2 will be
represented as <x10> to indicate that a JOIN is being performed on
another table (even though hist1 and hist2 are the same table). As we
discussed in July, it's still difficult for QueryBooster to determine if
two tables with different alias are the same without refactoring the code.
This is only a temporary fix and the user still needs to manually replace
to make the rule meaningful in a pairwise comparison 😢
—
Reply to this email directly, view it on GitHub
<#48 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB542BXSST5ULEZHUHAUMFTZYM4FFAVCNFSM6AAAAABO3QLXF2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMRZGY2TONRZGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Close this PR as discussed |
Changes Made
patternTable
andrewriteTable
intables
method.tables
method.Testing
test