Add minimal IPL data supplement to distinguish two semantically different SQL queries#181
Open
tohpinren wants to merge 1 commit intoxlang-ai:mainfrom
Open
Add minimal IPL data supplement to distinguish two semantically different SQL queries#181tohpinren wants to merge 1 commit intoxlang-ai:mainfrom
tohpinren wants to merge 1 commit intoxlang-ai:mainfrom
Conversation
Author
|
Hi @lfy79001, following up on this PR. Would appreciate any feedback when convenient. Happy to clarify or make changes if needed. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi Spider2 maintainers,
While analyzing the Spider2-Lite (SQLite) IPL dataset, I found a case where the current database contents cannot distinguish two semantically different SQL queries under execution.
Since Spider2 relies on execution-based evaluation, this means the dataset currently treats both queries as equivalent even though they implement different logic.
The original natural-language question is:
On the current IPL sample, both queries return the same result (an empty set). The root cause is that the IPL sample rows do not contain any overlapping keys between
ball_by_ballandbatsman_scoredon(match_id, over_id, ball_id, innings_no).Because of this, the join between these two tables produces zero rows, which causes the first CTE to be empty and the rest of the query pipeline to also be empty. As a result, both queries return no rows regardless of their final join predicate, masking their semantic difference.
This PR introduces a minimal counterexample so that this semantic difference becomes observable under execution.
Query description
The query identifies players who scored at least 100 runs in a match and were on the losing team, and returns their names.
It works in four steps:
team in that match.
Query 1
Query 2
This query is identical except for the final join condition:
Why the queries are different
The queries differ only in the final join predicate:
p.player_id = plt.player_idp.player_id <> plt.player_idThe first joins players to the qualifying records on matching IDs.
The second joins players on non-matching IDs, which produces a different result set.
Change introduced in this PR
This PR adds a minimal counterexample consisting of 8 rows across 8 IPL tables.
With these rows added:
This makes the semantic difference between the two queries observable under execution.