You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by xu...@apache.org on 2022/06/24 16:09:40 UTC

[arrow-datafusion] branch master updated: Automated generation of configs.md (#2777)

This is an automated email from the ASF dual-hosted git repository.

xudong963 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 11ae73755 Automated generation of configs.md (#2777)
11ae73755 is described below

commit 11ae73755314b4f0565dbca8cd99e6f7678a0083
Author: Mike Roberts <42...@users.noreply.github.com>
AuthorDate: Fri Jun 24 17:09:34 2022 +0100

    Automated generation of configs.md (#2777)
    
    * Add dev/update-config-docs.sh for generation of configs.md
    
    * Add prettier to configs docs script
    
    * Rename dev/update-config-docs.sh to dev/update_config_docs.sh
---
 datafusion/core/src/bin/print_config_docs.rs | 23 ++++++++++
 dev/update_config_docs.sh                    | 68 ++++++++++++++++++++++++++++
 docs/source/user-guide/configs.md            |  6 +++
 3 files changed, 97 insertions(+)

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 000000000..6e66fea5f
--- /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 000000000..9e955229c
--- /dev/null
+++ b/dev/update_config_docs.sh
@@ -0,0 +1,68 @@
+#!/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"
+<!---
+  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.
+-->
+
+<!---
+This file was generated by the dev/update_config_docs.sh script.
+Do not edit it manually as changes will be overwritten.
+Instead, edit dev/update_config_docs.sh or the docstrings in datafusion/core/src/config.rs.
+-->
+
+# 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 "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 9560a1f60..c82ab2eb7 100644
--- a/docs/source/user-guide/configs.md
+++ b/docs/source/user-guide/configs.md
@@ -17,6 +17,12 @@
   under the License.
 -->
 
+<!---
+This file was generated by the dev/update_config_docs.sh script.
+Do not edit it manually as changes will be overwritten.
+Instead, edit dev/update_config_docs.sh or the docstrings in datafusion/core/src/config.rs.
+-->
+
 # Configuration Settings
 
 The following configuration options can be passed to `SessionConfig` to control various aspects of query execution.