-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add sqlite test files, progress bar, and automatic postgres container management into sqllogictests #13936
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
Merged
Merged
Add sqlite test files, progress bar, and automatic postgres container management into sqllogictests #13936
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a18c82f
Fix md5 return_type to only return Utf8 as per current code impl.
Omega359 ad50ae6
Merge remote-tracking branch 'origin/main'
Omega359 1e87f7e
Merge remote-tracking branch 'origin/main'
Omega359 cc1f540
Merge remote-tracking branch 'origin/main'
Omega359 a733c8f
Merge remote-tracking branch 'origin/main'
Omega359 87b388e
Merge remote-tracking branch 'origin/main'
Omega359 c8a9f58
Merge remote-tracking branch 'origin/main'
Omega359 f3929a6
Merge branch 'apache:main' into main
Omega359 2b1af71
Add support for sqlite test files to sqllogictest
Omega359 c4650b9
Force version 0.24.0 of sqllogictest dependency until issue with labe…
Omega359 ba62846
Removed workaround for bug that was fixed.
Omega359 d452068
Git submodule update ... err update, link to sqlite tests.
Omega359 c297c81
Git submodule update
Omega359 5230c8b
Readd submodule
alamb de58d35
Merge pull request #3 from alamb/alamb/fix_datafusion-testing
Omega359 bbb66b4
Merge remote-tracking branch 'origin/main' into sqllogictest_with_sqlite
Omega359 a9296c7
Merge remote-tracking branch 'origin/sqllogictest_with_sqlite' into s…
Omega359 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Submodule datafusion-testing
added at
e2e320
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,14 @@ This crate is a submodule of DataFusion that contains an implementation of [sqll | |
## Overview | ||
|
||
This crate uses [sqllogictest-rs](https://github.com/risinglightdb/sqllogictest-rs) to parse and run `.slt` files in the | ||
[`test_files`](test_files) directory of this crate. | ||
[`test_files`](test_files) directory of this crate or the [`data/sqlite`](sqlite) | ||
directory of the datafusion-testing crate. | ||
|
||
## Testing setup | ||
|
||
1. `rustup update stable` DataFusion uses the latest stable release of rust | ||
2. `git submodule init` | ||
3. `git submodule update` | ||
3. `git submodule update --init --remote --recursive` | ||
|
||
## Running tests: TLDR Examples | ||
|
||
|
@@ -160,7 +161,7 @@ cargo test --test sqllogictests -- information | |
Test files that start with prefix `pg_compat_` verify compatibility | ||
with Postgres by running the same script files both with DataFusion and with Postgres | ||
|
||
In order to run the sqllogictests running against a previously running Postgres instance, do: | ||
In order to have the sqllogictest run against an existing running Postgres instance, do: | ||
|
||
```shell | ||
PG_COMPAT=true PG_URI="postgresql://[email protected]/postgres" cargo test --features=postgres --test sqllogictests | ||
|
@@ -172,7 +173,7 @@ The environment variables: | |
2. `PG_URI` contains a `libpq` style connection string, whose format is described in | ||
[the docs](https://docs.rs/tokio-postgres/latest/tokio_postgres/config/struct.Config.html#url) | ||
|
||
One way to create a suitable a posgres container in docker is to use | ||
One way to create a suitable a postgres container in docker is to use | ||
the [Official Image](https://hub.docker.com/_/postgres) with a command | ||
such as the following. Note the collation **must** be set to `C` otherwise | ||
`ORDER BY` will not match DataFusion and the tests will diff. | ||
|
@@ -185,6 +186,15 @@ docker run \ | |
postgres | ||
``` | ||
|
||
If you do not want to create a new postgres database and you have docker | ||
installed you can skip providing a PG_URI env variable and the sqllogictest | ||
runner will automatically create a temporary postgres docker container. | ||
For example: | ||
|
||
```shell | ||
PG_COMPAT=true cargo test --features=postgres --test sqllogictests | ||
``` | ||
|
||
## Running Tests: `tpch` | ||
|
||
Test files in `tpch` directory runs against the `TPCH` data set (SF = | ||
|
@@ -205,6 +215,34 @@ Then you need to add `INCLUDE_TPCH=true` to run tpch tests: | |
INCLUDE_TPCH=true cargo test --test sqllogictests | ||
``` | ||
|
||
## Running Tests: `sqlite` | ||
|
||
Test files in `data/sqlite` directory of the datafusion-testing crate were | ||
sourced from the [sqlite test suite](https://www.sqlite.org/sqllogictest/dir?ci=tip) and have been cleansed and updated to | ||
run within DataFusion's sqllogictest runner. | ||
|
||
To run the sqlite tests you need to increase the rust stack size and add | ||
`INCLUDE_SQLITE=true` to run the sqlite tests: | ||
|
||
```shell | ||
export RUST_MIN_STACK=30485760; | ||
INCLUDE_SQLITE=true cargo test --test sqllogictests | ||
``` | ||
|
||
Note that there are well over 5 million queries in these tests and running the | ||
sqlite tests will take a long time. You may wish to run them in release-nonlto mode: | ||
|
||
```shell | ||
INCLUDE_SQLITE=true cargo test --profile release-nonlto --test sqllogictests | ||
``` | ||
|
||
The sqlite tests can also be run with the postgres runner to verify compatibility: | ||
|
||
```shell | ||
export RUST_MIN_STACK=30485760; | ||
PG_COMPAT=true INCLUDE_SQLITE=true cargo test --features=postgres --test sqllogictests | ||
``` | ||
|
||
## Updating tests: Completion Mode | ||
|
||
In test script completion mode, `sqllogictests` reads a prototype script and runs the statements and queries against the | ||
|
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.