-
Notifications
You must be signed in to change notification settings - Fork 58
Description
sqllogictest v0.21.0 (and earlier versions, with slightly different APIs) has Validator and ColumnTypeValidator, and the caller is supposed to use those the verify that the results match the expectations.
You're merely allowed to compare types from the SLT and the query against each other, and the stringified values against each other. So let's examine where the observed values come from:
The DB::run and AsyncDB::run methods must return a DBOutput. and to do that the runner has to decide the column type. It does not get the "expected column type" from the SLT file.
I fear this API is impossible to use correctly!
As far as I can tell, sqllogictest actually outputs different stringified results based on what column type the SLT file says. If the column type is I, the output string is an integer even when the underlying SQL datatype was REAL. If the column type is R, the output is a decimal string like 42.001.
Here's some examples from the sqllogictest fossil repository. Note how the stringified result of avg() seems to depend on the stated SLT column type:
query I nosort
SELECT avg(y) FROM t1
----
0
query R nosort
SELECT avg(DISTINCT x) FROM t1
----
1.000
In my runner, if I'm constructing a DBOutput, and my result column is a REAL, I have no way of knowing whether I'm supposed to output decimal or integer values. That information is in the SLT file, but sqllogictest-rs's API does not let me access it.
Am I missing something?