From 30b94a7109755ee72d5e5f2044308a85319d79cd Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 13 Oct 2022 13:41:50 -0400 Subject: [PATCH 1/2] Add datafusion-cli documentation on showing configuration --- docs/source/user-guide/cli.md | 54 ++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/docs/source/user-guide/cli.md b/docs/source/user-guide/cli.md index e692f4adc7bd..f334df3127d4 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,55 @@ 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. +``` From c17e2685cd83e15cd318fc1e2a1b79b79edd2987 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Thu, 13 Oct 2022 13:49:43 -0400 Subject: [PATCH 2/2] prettier --- docs/source/user-guide/cli.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/user-guide/cli.md b/docs/source/user-guide/cli.md index f334df3127d4..246ab9189615 100644 --- a/docs/source/user-guide/cli.md +++ b/docs/source/user-guide/cli.md @@ -254,8 +254,7 @@ Available commands inside DataFusion CLI are: ## Changing Configuration Options -All available configuration options can be seen using `SHOW -ALL` as described above. +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