sqllogictest-rs icon indicating copy to clipboard operation
sqllogictest-rs copied to clipboard

Support labels in query

Open Omega359 opened this issue 11 months ago • 6 comments

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

Omega359 avatar Dec 29 '24 22:12 Omega359

likely introduced by https://github.com/risinglightdb/sqllogictest-rs/pull/239?

skyzh avatar Dec 29 '24 23:12 skyzh

@mikel879881 has been blocked from the repo

skyzh avatar Dec 29 '24 23:12 skyzh

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 avatar Dec 30 '24 03:12 xxchan

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 avatar Jan 02 '25 04:01 fuyufjh

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

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

fuyufjh avatar Jan 02 '25 04:01 fuyufjh

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

Omega359 avatar Jan 02 '25 13:01 Omega359