Skip to content

Apache DataFusion SQL Query Engine

MINOR: Add datafusion-cli documentation on showing configuration (#3825)

Andrew Lamb716d1ed382c7
diff --git a/docs/source/user-guide/cli.md b/docs/source/user-guide/cli.md
index e692f4adc7..246ab91896 100644
--- a/docs/source/user-guide/cli.md
+++ b/docs/source/user-guide/cli.md
@@ -21,7 +21,7 @@
The DataFusion CLI is a command-line interactive SQL utility that allows
queries to be executed against any supported data files. It is a convenient way to
-try DataFusion out with your own data sources.
+try DataFusion out with your own data sources, and test out its SQL support.
## Example
@@ -231,3 +231,54 @@ Available commands inside DataFusion CLI are:
```bash
> \h function_table
```
+
+- Show configuration options
+
+```SQL
+> show all;
+
++-------------------------------------------------+---------+
+| name | setting |
++-------------------------------------------------+---------+
+| datafusion.execution.batch_size | 8192 |
+| datafusion.execution.coalesce_batches | true |
+| datafusion.execution.coalesce_target_batch_size | 4096 |
+| datafusion.execution.time_zone | UTC |
+| datafusion.explain.logical_plan_only | false |
+| datafusion.explain.physical_plan_only | false |
+| datafusion.optimizer.filter_null_join_keys | false |
+| datafusion.optimizer.skip_failed_rules | true |
++-------------------------------------------------+---------+
+
+```
+
+## Changing Configuration Options
+
+All available configuration options can be seen using `SHOW ALL` as described above.
+
+You can change the configuration options using environment
+variables. `datafusion-cli` looks in the corresponding environment
+variable with an upper case name and all `.` is converted to `_`.
+
+For example, to set `datafusion.execution.batch_size` to `1024` you
+would set the `DATAFUSION_EXECUTION_BATCH_SIZE` environment variable
+appropriately:
+
+```shell
+$ DATAFUSION_EXECUTION_BATCH_SIZE=1024 datafusion-cli
+DataFusion CLI v12.0.0
+❯ show all;
++-------------------------------------------------+---------+
+| name | setting |
++-------------------------------------------------+---------+
+| datafusion.execution.batch_size | 1024 |
+| datafusion.execution.coalesce_batches | true |
+| datafusion.execution.coalesce_target_batch_size | 4096 |
+| datafusion.execution.time_zone | UTC |
+| datafusion.explain.logical_plan_only | false |
+| datafusion.explain.physical_plan_only | false |
+| datafusion.optimizer.filter_null_join_keys | false |
+| datafusion.optimizer.skip_failed_rules | true |
++-------------------------------------------------+---------+
+8 rows in set. Query took 0.002 seconds.
+```