Skip to content

Apache DataFusion SQL Query Engine

minor: improve sqllogictest docs (#5553)

Andrew Lambdd98aabdaebc
diff --git a/datafusion/core/tests/sqllogictests/README.md b/datafusion/core/tests/sqllogictests/README.md
index f3a06ec5a6..6591161dd3 100644
--- a/datafusion/core/tests/sqllogictests/README.md
+++ b/datafusion/core/tests/sqllogictests/README.md
@@ -19,25 +19,41 @@
#### Overview
-This is the Datafusion implementation of [sqllogictest](https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki). We use [sqllogictest-rs](https://github.com/risinglightdb/sqllogictest-rs) as a parser/runner of `.slt` files in `test_files`.
+This is the Datafusion implementation of [sqllogictest](https://www.sqlite.org/sqllogictest/doc/trunk/about.wiki). We use [sqllogictest-rs](https://github.com/risinglightdb/sqllogictest-rs) as a parser/runner of `.slt` files in [`test_files`](test_files).
-#### Running tests: Validation Mode
+#### Running tests: TLDR Examples
-In this model, `sqllogictests` runs the statements and queries in a `.slt` file, comparing the expected output in the file to the output produced by that run.
+```shell
+# Run all tests
+cargo test -p datafusion --test sqllogictests
+```
-Run all tests suites in validation mode
+```shell
+# Run all tests, with debug logging enabled
+RUST_LOG=debug cargo test -p datafusion --test sqllogictests
+```
```shell
-cargo test -p datafusion --test sqllogictests
+# Run only the tests in `information_schema.slt`
+cargo test -p datafusion --test sqllogictests -- information_schema
```
-Run tests with debug logging enabled:
+```shell
+# Automatically update ddl.slt with expected output
+cargo test -p datafusion --test sqllogictests -- ddl --complete
+```
+
+#### Running tests: Validation Mode
+
+In this model, `sqllogictests` runs the statements and queries in a `.slt` file, comparing the expected output in the file to the output produced by that run.
+
+For example, to run all tests suites in validation mode
```shell
-RUST_LOG=debug cargo test -p datafusion --test sqllogictests
+cargo test -p datafusion --test sqllogictests
```
-Run only the tests in `information_schema.slt`:
+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`