From 22ae6cdd0f8862a1610af4a088e232767301a3cb Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Thu, 23 Jun 2022 16:33:33 +0100 Subject: [PATCH 1/3] Add dev/update-config-docs.sh for generation of configs.md --- datafusion/core/src/bin/print_config_docs.rs | 23 +++++++ dev/update-config-docs.sh | 65 ++++++++++++++++++++ docs/source/user-guide/configs.md | 13 +++- 3 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 datafusion/core/src/bin/print_config_docs.rs create mode 100755 dev/update-config-docs.sh diff --git a/datafusion/core/src/bin/print_config_docs.rs b/datafusion/core/src/bin/print_config_docs.rs new file mode 100644 index 0000000000000..6e66fea5fe514 --- /dev/null +++ b/datafusion/core/src/bin/print_config_docs.rs @@ -0,0 +1,23 @@ +// 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. + +use datafusion::config::BuiltInConfigs; + +fn main() { + let docs = BuiltInConfigs::generate_config_markdown(); + println!("{}", docs); +} diff --git a/dev/update-config-docs.sh b/dev/update-config-docs.sh new file mode 100755 index 0000000000000..30748627c8742 --- /dev/null +++ b/dev/update-config-docs.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# +# 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. +# + +set -e + +SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SOURCE_DIR}/../" && pwd + +TARGET_FILE="docs/source/user-guide/configs.md" +PRINT_DOCS_COMMAND="cargo run --manifest-path datafusion/core/Cargo.toml --bin print_config_docs" + +echo "Inserting header" +cat <<'EOF' > "$TARGET_FILE" + + + + +# Configuration Settings + +The following configuration options can be passed to `SessionConfig` to control various aspects of query execution. + +EOF + +echo "Running CLI and inserting docs table" +$PRINT_DOCS_COMMAND >> "$TARGET_FILE" + +echo "'$TARGET_FILE' successfully updated!" diff --git a/docs/source/user-guide/configs.md b/docs/source/user-guide/configs.md index 9560a1f60100c..c85647c762f68 100644 --- a/docs/source/user-guide/configs.md +++ b/docs/source/user-guide/configs.md @@ -17,10 +17,17 @@ under the License. --> + + # Configuration Settings The following configuration options can be passed to `SessionConfig` to control various aspects of query execution. -| key | type | default | description | -| --------------------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| datafusion.optimizer.filterNullJoinKeys | Boolean | false | When set to true, the optimizer will insert filters before a join between a nullable and non-nullable column to filter out nulls on the nullable side. This filter can add additional overhead when the file format does not fully support predicate push down. | +| key | type | default | description | +|-----|------|---------|-------------| +| datafusion.optimizer.filterNullJoinKeys | Boolean | false | When set to true, the optimizer will insert filters before a join between a nullable and non-nullable column to filter out nulls on the nullable side. This filter can add additional overhead when the file format does not fully support predicate push down. | + From b197714eea10317175ccd09535fcfa95957b2e68 Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Thu, 23 Jun 2022 17:28:36 +0100 Subject: [PATCH 2/3] Add prettier to configs docs script --- dev/update-config-docs.sh | 3 +++ docs/source/user-guide/configs.md | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dev/update-config-docs.sh b/dev/update-config-docs.sh index 30748627c8742..9888539a9e52c 100755 --- a/dev/update-config-docs.sh +++ b/dev/update-config-docs.sh @@ -62,4 +62,7 @@ EOF echo "Running CLI and inserting docs table" $PRINT_DOCS_COMMAND >> "$TARGET_FILE" +echo "Running prettier" +npx prettier@2.3.2 --write "$TARGET_FILE" + echo "'$TARGET_FILE' successfully updated!" diff --git a/docs/source/user-guide/configs.md b/docs/source/user-guide/configs.md index c85647c762f68..d964734c88ff2 100644 --- a/docs/source/user-guide/configs.md +++ b/docs/source/user-guide/configs.md @@ -27,7 +27,6 @@ Instead, edit dev/update-config-docs.sh or the docstrings in datafusion/core/src The following configuration options can be passed to `SessionConfig` to control various aspects of query execution. -| key | type | default | description | -|-----|------|---------|-------------| -| datafusion.optimizer.filterNullJoinKeys | Boolean | false | When set to true, the optimizer will insert filters before a join between a nullable and non-nullable column to filter out nulls on the nullable side. This filter can add additional overhead when the file format does not fully support predicate push down. | - +| key | type | default | description | +| --------------------------------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| datafusion.optimizer.filterNullJoinKeys | Boolean | false | When set to true, the optimizer will insert filters before a join between a nullable and non-nullable column to filter out nulls on the nullable side. This filter can add additional overhead when the file format does not fully support predicate push down. | From 946053f8e80f28d7abaa47669e05250cc5102305 Mon Sep 17 00:00:00 2001 From: Mike Roberts Date: Fri, 24 Jun 2022 15:43:34 +0100 Subject: [PATCH 3/3] Rename dev/update-config-docs.sh to dev/update_config_docs.sh --- dev/{update-config-docs.sh => update_config_docs.sh} | 4 ++-- docs/source/user-guide/configs.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename dev/{update-config-docs.sh => update_config_docs.sh} (94%) diff --git a/dev/update-config-docs.sh b/dev/update_config_docs.sh similarity index 94% rename from dev/update-config-docs.sh rename to dev/update_config_docs.sh index 9888539a9e52c..9e955229cc8ee 100755 --- a/dev/update-config-docs.sh +++ b/dev/update_config_docs.sh @@ -48,9 +48,9 @@ cat <<'EOF' > "$TARGET_FILE" --> # Configuration Settings diff --git a/docs/source/user-guide/configs.md b/docs/source/user-guide/configs.md index d964734c88ff2..c82ab2eb7c50c 100644 --- a/docs/source/user-guide/configs.md +++ b/docs/source/user-guide/configs.md @@ -18,9 +18,9 @@ --> # Configuration Settings