Skip to content
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

Support labels in query #242

Open
Omega359 opened this issue Dec 29, 2024 · 6 comments
Open

Support labels in query #242

Omega359 opened this issue Dec 29, 2024 · 6 comments

Comments

@Omega359
Copy link
Contributor

As seen in Datafusion when attempting to parse the sqlite test suite:

External error: task 27341 panicked with message "called Result::unwrap() on an Err value: ParseError { kind: UnexpectedToken("label-1"), loc: Location { file: "../../datafusion-testing/data/sqlite/random/select/slt_good_21.slt", line: 47, upper: None } }"

The line referenced above is:

query I rowsort label-1 
SELECT + 94 / - col2 + col1 + 9 FROM tab0 AS cor0 
---- 
12 
93 
99

I believe the issue is the new retry code does not account for labels as documented @ https://sqlite.org/sqllogictest/doc/trunk/about.wiki

@skyzh
Copy link
Member

skyzh commented Dec 29, 2024

likely introduced by #239?

@skyzh
Copy link
Member

skyzh commented Dec 29, 2024

@mikel879881 has been blocked from the repo

@xxchan
Copy link
Member

xxchan commented Dec 30, 2024

Yes, label was removed from parser in #239, because it's actually never supported in runner. It seems it's used in sqlite's test suite. You may use 0.24.0 for now. PR to add it back is welcome!

@xxchan xxchan changed the title Receiving unexpected token error with 0.25.0 Support labels in query Dec 30, 2024
@fuyufjh
Copy link
Contributor

fuyufjh commented Jan 2, 2025

Sorry about that, I'll try to see if I can bring back this feature. Unfortunately, there isn't a test case that covers this functionality (label).

@fuyufjh
Copy link
Contributor

fuyufjh commented Jan 2, 2025

Oh, wait, I must clarify one thing. As mentioned in #238,

Also removed label from QueryExpect::Results because it's never used.

The <label> was supported by Parser, but never functions as expected:

The argument is also optional. If included, sqllogictest stores a hash of the results of this query under the given label. If the label is reused, then sqllogictest verifies that the results are the same. This can be used to verify that two or more queries in the same test script that are logically equivalent always generate the same output.

Thus, <label> is actually a missing feature compared with sqllogictest. Feel free to contribute.

@Omega359
Copy link
Contributor Author

Omega359 commented Jan 2, 2025

If I find time this month I may work on this as it would be a nice feature to have.

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

No branches or pull requests

5 participants
@Omega359 @skyzh @fuyufjh @xxchan and others