-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move sqllogictests to sqllogictests crate to break cyclic dependency (#…
…7284) * Move sqllogictests to datafusion-sqllogictest module * Port code to be in datafusion * Update expected output * update workflows * update flow * update postgres check * fmt * clippy * Add moved * Add RAT to MOVED.md * Fix tpch instructions and tests
- Loading branch information
Showing
94 changed files
with
308 additions
and
271 deletions.
There are no files selected for viewing
This file contains 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 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 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 was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
The SQL Logic Test code has moved to `datafusion/sqllogictest` |
This file contains 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.py | ||
test_files/tpch/data |
This file contains 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 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 |
---|---|---|
|
@@ -33,27 +33,27 @@ in [`test_files`](test_files). | |
|
||
```shell | ||
# Run all tests | ||
cargo test -p datafusion --test sqllogictests | ||
cargo test --test sqllogictests | ||
``` | ||
|
||
```shell | ||
# Run all tests, with debug logging enabled | ||
RUST_LOG=debug cargo test -p datafusion --test sqllogictests | ||
RUST_LOG=debug cargo test --test sqllogictests | ||
``` | ||
|
||
```shell | ||
# Run only the tests in `information_schema.slt` | ||
cargo test -p datafusion --test sqllogictests -- information_schema | ||
cargo test --test sqllogictests -- information_schema | ||
``` | ||
|
||
```shell | ||
# Automatically update ddl.slt with expected output | ||
cargo test -p datafusion --test sqllogictests -- ddl --complete | ||
cargo test --test sqllogictests -- ddl --complete | ||
``` | ||
|
||
```shell | ||
# Run ddl.slt, printing debug logging to stdout | ||
RUST_LOG=debug cargo test -p datafusion --test sqllogictests -- ddl | ||
RUST_LOG=debug cargo test --test sqllogictests -- ddl | ||
``` | ||
|
||
#### Cookbook: Adding Tests | ||
|
@@ -76,7 +76,7 @@ SELECT * from foo; | |
Running the following command will update `my_awesome_test.slt` with the expected output: | ||
|
||
```shell | ||
cargo test -p datafusion --test sqllogictests -- my_awesome_test --complete | ||
cargo test --test sqllogictests -- my_awesome_test --complete | ||
``` | ||
|
||
3. Verify the content | ||
|
@@ -105,14 +105,14 @@ file to the output produced by that run. | |
For example, to run all tests suites in validation mode | ||
|
||
```shell | ||
cargo test -p datafusion --test sqllogictests | ||
cargo test --test sqllogictests | ||
``` | ||
|
||
sqllogictests also supports `cargo test` style substring matches on file names to restrict which tests to run | ||
|
||
```shell | ||
# information_schema.slt matches due to substring matching `information` | ||
cargo test -p datafusion --test sqllogictests -- information | ||
cargo test --test sqllogictests -- information | ||
``` | ||
|
||
#### Running tests: Postgres compatibility | ||
|
@@ -123,7 +123,7 @@ with Postgres by running the same script files both with DataFusion and with Pos | |
In order to run the sqllogictests running against a previously running Postgres instance, do: | ||
|
||
```shell | ||
PG_COMPAT=true PG_URI="postgresql://[email protected]/postgres" cargo test -p datafusion --test sqllogictests | ||
PG_COMPAT=true PG_URI="postgresql://[email protected]/postgres" cargo test --features=postgres --test sqllogictests | ||
``` | ||
|
||
The environemnt variables: | ||
|
@@ -153,15 +153,16 @@ command to generate tpch data, assuming you are in the repository | |
root: | ||
|
||
```shell | ||
mkdir -p datafusion/sqllogictest/test_files/tpch/data | ||
docker run -it \ | ||
-v "$(realpath datafusion/core/tests/sqllogictests/test_files/tpch/data)":/data \ | ||
-v "$(realpath datafusion/sqllogictest/test_files/tpch/data)":/data \ | ||
ghcr.io/databloom-ai/tpch-docker:main -vf -s 0.1 | ||
``` | ||
|
||
Then you need to add `INCLUDE_TPCH=true` to run tpch tests: | ||
|
||
```shell | ||
INCLUDE_TPCH=true cargo test -p datafusion --test sqllogictests | ||
INCLUDE_TPCH=true cargo test --test sqllogictests | ||
``` | ||
|
||
#### Updating tests: Completion Mode | ||
|
@@ -173,7 +174,7 @@ You can update the tests / generate expected output by passing the `--complete` | |
|
||
```shell | ||
# Update ddl.slt with output from running | ||
cargo test -p datafusion --test sqllogictests -- ddl --complete | ||
cargo test --test sqllogictests -- ddl --complete | ||
``` | ||
|
||
#### sqllogictests | ||
|
This file contains 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 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 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
Oops, something went wrong.