Apache DataFusion SQL Query Engine
minor: fix doctest that runs accidentally (#5989)
Yijie Shena55d805e5504
diff --git a/.github/workflows/docs_pr.yaml b/.github/workflows/docs_pr.yamlnew file mode 100644index 0000000000..435006ed93--- /dev/null+++ b/.github/workflows/docs_pr.yaml@@ -0,0 +1,54 @@+# 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.++name: Docs++concurrency:+ group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}+ cancel-in-progress: true++on:+ push:+ paths:+ - "docs/**"+ pull_request:+ paths:+ - "docs/**"+ # manual trigger+ # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow+ workflow_dispatch:++jobs:+ # Run doc tests+ linux-test-doc:+ name: cargo doctest (amd64)+ runs-on: ubuntu-latest+ container:+ image: amd64/rust+ steps:+ - uses: actions/checkout@v3+ with:+ submodules: true+ - name: Setup Rust toolchain+ uses: ./.github/actions/setup-builder+ with:+ rust-version: stable+ # Note: this does not include dictionary_expressions to reduce codegen+ - name: Run doctests+ run: cargo test --doc --features avro,jit,scheduler,json+ - name: Verify Working Directory Clean+ run: git diff --exit-codediff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.mdindex fd3c4cf183..d8e7e3c882 100644--- a/docs/source/user-guide/example-usage.md+++ b/docs/source/user-guide/example-usage.md@@ -175,12 +175,13 @@ codegen-units = 1Then, in `main.rs.` update the memory allocator with the below after your imports:-```rust+```rust,ignoreuse datafusion::prelude::*;#[global_allocator]static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;+#[tokio::main]async fn main() -> datafusion::error::Result<()> {Ok(())}@@ -195,6 +196,6 @@ rustup toolchain install nightlyBased on the instruction set architecture you are building on you will want to configure the `target-cpu` as well, ideallywith `native` or at least `avx2`.-```+```shellRUSTFLAGS='-C target-cpu=native' cargo +nightly run --release```