@@ -28,13 +28,14 @@ This crate is a submodule of DataFusion that contains an implementation of [sqll
2828## Overview
2929
3030This crate uses [ sqllogictest-rs] ( https://github.com/risinglightdb/sqllogictest-rs ) to parse and run ` .slt ` files in the
31- [ ` test_files ` ] ( test_files ) directory of this crate.
31+ [ ` test_files ` ] ( test_files ) directory of this crate or the [ ` data/sqlite ` ] ( sqlite )
32+ directory of the datafusion-testing crate.
3233
3334## Testing setup
3435
35361 . ` rustup update stable ` DataFusion uses the latest stable release of rust
36372 . ` git submodule init `
37- 3 . ` git submodule update `
38+ 3 . ` git submodule update --init --remote --recursive `
3839
3940## Running tests: TLDR Examples
4041
@@ -160,7 +161,7 @@ cargo test --test sqllogictests -- information
160161Test files that start with prefix ` pg_compat_ ` verify compatibility
161162with Postgres by running the same script files both with DataFusion and with Postgres
162163
163- In order to run the sqllogictests running against a previously running Postgres instance, do:
164+ In order to have the sqllogictest run against an existing running Postgres instance, do:
164165
165166``` shell
166167PG_COMPAT=true PG_URI=
" postgresql://[email protected] /postgres" cargo
test --features=postgres --test sqllogictests
@@ -172,7 +173,7 @@ The environment variables:
1721732 . ` PG_URI ` contains a ` libpq ` style connection string, whose format is described in
173174 [ the docs] ( https://docs.rs/tokio-postgres/latest/tokio_postgres/config/struct.Config.html#url )
174175
175- One way to create a suitable a posgres container in docker is to use
176+ One way to create a suitable a postgres container in docker is to use
176177the [ Official Image] ( https://hub.docker.com/_/postgres ) with a command
177178such as the following. Note the collation ** must** be set to ` C ` otherwise
178179` ORDER BY ` will not match DataFusion and the tests will diff.
@@ -185,6 +186,15 @@ docker run \
185186 postgres
186187```
187188
189+ If you do not want to create a new postgres database and you have docker
190+ installed you can skip providing a PG_URI env variable and the sqllogictest
191+ runner will automatically create a temporary postgres docker container.
192+ For example:
193+
194+ ``` shell
195+ PG_COMPAT=true cargo test --features=postgres --test sqllogictests
196+ ```
197+
188198## Running Tests: ` tpch `
189199
190200Test 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:
205215INCLUDE_TPCH=true cargo test --test sqllogictests
206216```
207217
218+ ## Running Tests: ` sqlite `
219+
220+ Test files in ` data/sqlite ` directory of the datafusion-testing crate were
221+ sourced from the [ sqlite test suite] ( https://www.sqlite.org/sqllogictest/dir?ci=tip ) and have been cleansed and updated to
222+ run within DataFusion's sqllogictest runner.
223+
224+ To run the sqlite tests you need to increase the rust stack size and add
225+ ` INCLUDE_SQLITE=true ` to run the sqlite tests:
226+
227+ ``` shell
228+ export RUST_MIN_STACK=30485760;
229+ INCLUDE_SQLITE=true cargo test --test sqllogictests
230+ ```
231+
232+ Note that there are well over 5 million queries in these tests and running the
233+ sqlite tests will take a long time. You may wish to run them in release-nonlto mode:
234+
235+ ``` shell
236+ INCLUDE_SQLITE=true cargo test --profile release-nonlto --test sqllogictests
237+ ```
238+
239+ The sqlite tests can also be run with the postgres runner to verify compatibility:
240+
241+ ``` shell
242+ export RUST_MIN_STACK=30485760;
243+ PG_COMPAT=true INCLUDE_SQLITE=true cargo test --features=postgres --test sqllogictests
244+ ```
245+
208246## Updating tests: Completion Mode
209247
210248In test script completion mode, ` sqllogictests ` reads a prototype script and runs the statements and queries against the
0 commit comments