You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Implement column number / column type verification for sqllogictest #4499
The standard way of verifying results of queries is using the query statement, followed by the letter I times the number of columns that are expected in the result.
query II
SELECT42, 84UNION ALLSELECT10, 20;
----42841020
At the moment, the datafusion sqllogictest framework entirely ignores the number of I after the query command
The goal of this ticket is to update the framework (and tests) to error if the number of Is doesn't match the number of columns
changed the title [-]Implement column number verification for sqllogictest[/-][+]Implement column number / column type verification for sqllogictest[/+]on Jan 8, 2023
Hey, guys!
I'd like to work on this issue, but I am not sure which way to go.
DuckDB suggests using 'I' just to verify the number of columns.
Sqllogic test defines 'T'(text), 'I' (integer), 'R' (floating number). CocroachDB defines even more types T, F(floating), R (decimal), B (boolean), O (oid), _ (any).
However, having a boolean type would've allowed writing a more concise test which would run for both Datafusion and Postgres
query BB
select null and null, null or null;
----
NULL NULL
Do you have preferences regarding the set of types?
sqllogictest-rs skips columns validation now, but defines columns I (integer), T (text), R (floating point), ? (any).
In order to use sqllogictest-rs one would need to define a type and a validation strategy. This would likely mean aligning with the other users of sqllogictest-rs.
I thought it would be more flexible to have a pluggable type and a validation strategy, so I opened a pr in sqllogictest-rsrisinglightdb/sqllogictest-rs#160. I would appreciate your feedback.
As long as the --complete mode is able to populate the appropriate types automatically I am all for adding more specific types. It would be unfortunate if in order to write sqllogictests in datafusion you had to know a mapping from type to character code that has more than three entries :)
Activity
xxchan commentedon Dec 7, 2022
related issue: risinglightdb/sqllogictest-rs#36
[-]Implement column number verification for sqllogictest[/-][+]Implement column number / column type verification for sqllogictest[/+]melgenek commentedon Feb 7, 2023
Hey, guys!
I'd like to work on this issue, but I am not sure which way to go.
DuckDB suggests using 'I' just to verify the number of columns.
Sqllogic test defines 'T'(text), 'I' (integer), 'R' (floating number).
CocroachDB defines even more types
T,F(floating),R(decimal),B(boolean),O(oid),_(any).I think having more than one type is useful. For example, in order to verify that
null and nullproduces a NULL of type boolean, I needed to usepg_typeandarrow_typeto verify the result types.https://github.com/apache/arrow-datafusion/blob/7d2d51b651d076d720e2879661346babcda9734a/datafusion/core/tests/sqllogictests/test_files/pg_compat/pg_compat_type_coercion.slt#L98-L115
However, having a boolean type would've allowed writing a more concise test which would run for both Datafusion and Postgres
Do you have preferences regarding the set of types?
sqllogictest-rsskips columns validation now, but defines columnsI(integer),T(text),R(floating point),?(any).In order to use
sqllogictest-rsone would need to define a type and a validation strategy. This would likely mean aligning with the other users ofsqllogictest-rs.I thought it would be more flexible to have a pluggable type and a validation strategy, so I opened a pr in
sqllogictest-rsrisinglightdb/sqllogictest-rs#160. I would appreciate your feedback.alamb commentedon Feb 7, 2023
I agree
As long as the
--completemode is able to populate the appropriate types automatically I am all for adding more specific types. It would be unfortunate if in order to write sqllogictests in datafusion you had to know a mapping from type to character code that has more than three entries :)melgenek commentedon Feb 11, 2023
Hi.
I opened a pr to define the sqllogictest output types and check them #5253.
The
--completedoesn't work yet. There is a pr insqllogictest-rsto make it work risinglightdb/sqllogictest-rs#164.